| Author: Gaurav Agrawal 05 Sep 2008 | Member Level: Diamond | Rating: Points: 3 |
Hi On all pages at pageload() event call a simple function that checks that session is exits or not and if not exist then redirect to login page else doing ur work.
public check() { if(session["userid"]==null) response.redirect("login.aspx"); }
simple function to check the session Thanks GA
|
| Author: mythili d 05 Sep 2008 | Member Level: Silver | Rating: Points: 3 |
<authentication mode="Forms"> <forms timeout="10" slidingExpiration="true" name="your application name"></forms> </authentication> this will automatically log you out of the website and puts you on the unauthenticated page whihc is your login page. thanks
|
| Author: Vivek Sharma 06 Sep 2008 | Member Level: Gold | Rating: Points: 3 |
Hi, by default session timeout duration is 20 minuts we can increase the timeout value by changing in web config file up to one year.
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false" timeout="10" after expiration the session duration if you can redirect the user on login page againby using this code on page load
if(session["uid"]==null) Server.Transfer("Login.aspx");
|