Click here to Skip to main content
15,913,140 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
timeout not working in web.config

i want to redirect the end-user to "Logout.aspx" when time out by 1 minute

but it's not working....
here is my code..

<authentication mode="Forms">

<forms name=".ASPXAUTH" loginUrl="~/Logout.aspx?login=1" timeout="1" defaultUrl="FollowUps_Default.aspx" slidingExpiration="true" >

<authentication>

Thanks in advance
Posted
Comments
Mukesh Pr@sad 31-Oct-14 9:00am    
Once try following code

<forms loginUrl="~/Logout.aspx" timeout="1" />

You want to set the timeout on your Session element, not on the forms element. http://msdn.microsoft.com/en-us/library/h6bb9cz9(v=vs.85).aspx[^]

Also note, this will not automatically route users when they timeout because the web is disconnected. If you want to automatically send some to LogOut.aspx when their session ends you have to keep track of the time on the client side. It's not easy.

When the session times out if the user then tries to click on anything that causes a trip to the server, then they will be redirected to the LogOut.aspx page. But only if the user tries to do something that will hit the server (postbacks.)
 
Share this answer
 
try this link,it may help you to ridirect to another page when session expires.

http://www.dotnetgallery.com/kb/resource9-how-to-do-auto-logout-and-redirect-to-login-page-when-session-expires-using.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900