Josh_Blade
asked on
How to timeout an active session in C# .NET
I'd like to set our active sessions to timeout after 12 hours. I already have an idle timeout set up, but I'm curious how to set a timeout for an active session.
Set a cookie at the beginning of the session and set an expiration of 12 hours. Check that cookie every postback and if it doesn't exist, call Session.Abandon(). That will clear the session and force the session start to occur again and a new cookie to be created.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Response.AddHeader("Refres h", Session.Timeout + ";URL=Logoff.htm");
ASKER
Thanks a lot.