locked
How to keep maximum session duration? RRS feed

  • Question

  • User-786564416 posted

    I want to keep the session duration to maximum possible. How to make it and set it in the web.config file?

    Friday, August 4, 2017 7:52 AM

All replies

  • User1551896424 posted

    Hi

    alihusain_77,

    You can use timeout property of session state in web.config file as follows.

    <system.web>
     <sessionState mode="InProc" cookieless="false" timeout="80" />
    </system.web>

    Here as mentioned above timeout="80" will set your ideal time to 80 mins.  The maximum value is  525,600 minutes (1 year). 

    Friday, August 4, 2017 7:57 AM
  • User753101303 posted

    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.

    Friday, August 4, 2017 7:57 AM
  • User-1315512054 posted

    Hello,

    You should also increase the app pool time out.

    Regards

    Saturday, August 5, 2017 12:34 PM