Not sure what is the problem you are trying to solve but it might be best to avoid depending on long session ('for example being able to restore a value if the session terminated). You could also perhaps use the SQL Server session provider.
If you are trying to solve a problem it sometimes best to directly discuss the source issue which may give other ideas about how to solve it.
Member
56 Points
657 Posts
How to keep maximum session duration?
Aug 04, 2017 07:52 AM|alihusain_77|LINK
I want to keep the session duration to maximum possible. How to make it and set it in the web.config file?
Member
20 Points
24 Posts
Re: How to keep maximum session duration?
Aug 04, 2017 07:57 AM|rahulmarathe|LINK
Hi
alihusain_77,
You can use timeout property of session state in web.config file as follows.
Here as mentioned above timeout="80" will set your ideal time to 80 mins. The maximum value is 525,600 minutes (1 year).
All-Star
45870 Points
16703 Posts
Re: How to keep maximum session duration?
Aug 04, 2017 07:57 AM|PatriceSc|LINK
Hi,
You tried the timeout found at https://msdn.microsoft.com/en-us/library/h6bb9cz9(v=vs.100).aspx ? Or do you mean you want to change this programmtically ?
Not sure what is the problem you are trying to solve but it might be best to avoid depending on long session ('for example being able to restore a value if the session terminated). You could also perhaps use the SQL Server session provider.
If you are trying to solve a problem it sometimes best to directly discuss the source issue which may give other ideas about how to solve it.
Star
11650 Points
3462 Posts
Re: How to keep maximum session duration?
Aug 05, 2017 12:34 PM|HostingASPNet|LINK
Hello,
You should also increase the app pool time out.
Regards
HowtoASP.NET - Free ASP.NET tutorials with examples and source code.