Click here to Skip to main content
14,691,469 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
Hello Friends,
How to make session timeout anyhow after 3 min ,even when user is refresh Page or redirecting to other page in website. I don't want to restart the session timeout on page refresh. In short SESSION must be timeout after 3 min..

Can anyone help..

Thank You

1 solution

I don't think there is a "total session timeout" counter - the normal session is automatically renewed by a postback, so changing that doesn't help you much.
You can implement something like it though.
Set the Session timeout to three minutes.
When the Session starts, add a variable to the session with the current time, plus three minutes.
Each time you get a postback or a page load, check the timeout in the Session and see if it has expired. Probably, you want to do this as part of your Master Page, if you are using .NET.
JaspalSingh03 5-Jan-16 4:06am
I had tried Your solution,but everytime when i redirect to other page, a new session start.
OriginalGriff 5-Jan-16 4:15am
Check your code: Response.Redirect does not start a new session:
JaspalSingh03 5-Jan-16 5:37am
still not working...can you please send me the code,if you have.So that i can implement in my webpages.
OriginalGriff 5-Jan-16 5:51am
No, sorry - we have no idea how the rest of your system works, and we don't even know what language you are using! :laugh:
Show what you have tried - relevant fragments only, please - and we can look at it.

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