Hi Folks, Just a looking at this post to keep the sessions alive instead of increasing session timeout to a crazy number in web.config. Any Recomendations on this? Is it a good way?
I am using session Mode=SQL server. My sql server stores session information in UTC time format. In the above mentioned link's code should'nt I use datetime.utcnow.ticks instead of dateime.now.ticks.
Hi Folks, Just a looking at this post to keep the sessions alive instead of increasing session timeout to a crazy number in web.config. Any Recomendations on this? Is it a good way?
in the past I went for either a high number for the timeout or put a meta refresh element in my header which would autopostback to the server after a given amount of minutes.
Nowadays a quick ping to the server through ajax every x seconds is usually already enough. In the mean time you can request extra information like a status or unread messages or ...
The minimum allowed value of Session Timeout is 1 minute and the maximum is 1440 minutes.
If you want infinite sessions best thing is to migrate to out of process session modes like State Server or Sql Server or
Custom mode to specify a custom storage provider.
If you use InProc session mode for infinite sessions it may degrade application performance. Just imagine all the session objects of all users living in the in-memory of your application for very long time. So performance wise it is better to migrate to
out of process.
Please Mark as Answer if my post helps you..!
Thanks,
Prashanth Reddy
Marked as answer by Angie xu - MSFT on Dec 31, 2012 05:42 AM
shanewatz
Member
11 Points
30 Posts
Recomendations on keeping the sessions alive
Dec 23, 2012 01:11 PM|LINK
Hi Folks, Just a looking at this post to keep the sessions alive instead of increasing session timeout to a crazy number in web.config. Any Recomendations on this? Is it a good way?
http://www.primaryobjects.com/cms/article86.aspx
I am using session Mode=SQL server. My sql server stores session information in UTC time format. In the above mentioned link's code should'nt I use datetime.utcnow.ticks instead of dateime.now.ticks.
Any clues?
Regards,
Dan Bracuk
Contributor
3970 Points
1096 Posts
Re: Recomendations on keeping the sessions alive
Dec 23, 2012 01:29 PM|LINK
I've done something similar on occasion when I wanted to prevent a timeout in certain situations.
XIII
All-Star
182684 Points
23455 Posts
ASPInsiders
Moderator
MVP
Re: Recomendations on keeping the sessions alive
Dec 23, 2012 01:49 PM|LINK
Hi,
in the past I went for either a high number for the timeout or put a meta refresh element in my header which would autopostback to the server after a given amount of minutes.
Nowadays a quick ping to the server through ajax every x seconds is usually already enough. In the mean time you can request extra information like a status or unread messages or ...
update: actually what I was talking about got asked as well in another thread. Please take a look at this: http://forums.asp.net/t/1868072.aspx/1?Looking+for+some+code+explaination.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
PrashanthRed...
Member
559 Points
94 Posts
Re: Recomendations on keeping the sessions alive
Dec 26, 2012 08:45 PM|LINK
Hi shanewatz,
The minimum allowed value of Session Timeout is 1 minute and the maximum is 1440 minutes.
If you want infinite sessions best thing is to migrate to out of process session modes like State Server or Sql Server or Custom mode to specify a custom storage provider.
If you use InProc session mode for infinite sessions it may degrade application performance. Just imagine all the session objects of all users living in the in-memory of your application for very long time. So performance wise it is better to migrate to out of process.
Thanks,
Prashanth Reddy