问题
I am working on a asp.net 3.5 web application the session time-out is set to 24 hours but a recycling of ASPNet process on the server is scheduled to trigger everyday at 3:00 A.M. is causing the session to timed out.
What is the best solution and how to achieve it :
My code should constantly listen to the server and show a message to user and redirect him to home page after session is expired?
OR
A solution which makes a session to never timeout.
Thanks in advance BB
回答1:
Please refer this http://www.primaryobjects.com/CMS/Article86.aspx
回答2:
Make your session be stored in SQL server instead of in-memory. That way when the server recycles it wont affect the sessions at all.
来源:https://stackoverflow.com/questions/6946790/make-a-session-never-timeout-or-redirect-user-to-home-page-asp-net