how to redirect to loginpage after session timeout


F

francois

in my web.config i have the following :

<sessionState

mode="InProc"

stateConnectionString="tcpip=127.0.0.1:42424"

sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"

cookieless="false"

timeout="120"

/>



After 120 minutes of inactivity, the session times out and i lose my
session data. This is what I want, but I want that the user get redirected
to the logon page if it happens that he is hitting the server again once his
session is already timed out. Is there any mechanism allowing this in
theASP.NET framework? Or is it something I have to do "manually"?

Thanks in adcance and best regards,

Francois
 
Ad

Advertisements

G

Guest

Hi Francois
If you are using forms authentication then you can use
<forms loginUrl="login.aspx" ...../> which redirects to the login page when the session is timed out.
Otherwise you can redirect the user to the login page in the Session_End event in the global.asax
Hope that helps :
srini
 
Ad

Advertisements

A

Ather Ali Shaikh

Hello
I am using Forms Authentication. but the page is not redirect to desired
login page after session is expired.
When I debug the application. Session_end is called. in the Session_End
method i write code to redirect to the LoginPage but it is still not
redirecting. it runs the redirecting code but physically not redirect.

What should I do more.?

Regards
Ather Ali
----- Original Message -----
From: "francois" <[email protected]_NOSPAM>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Tuesday, May 25, 2004 09:05
Subject: how to redirect to loginpage after session timeout
 

Top