hi RRS feed

  • Question

  • User256534580 posted

    how to maintain session variables in a long time..



    Thursday, March 17, 2011 11:47 PM


All replies

  • User-1971614856 posted

    You can use the <sessionstate in your web.config under the <system.web> section.

    For example


    <sessionState timeout="60"/>



    Now your session will remain for 60 minutes even your Website remains IDLE. You can set 60 to whatever value you required.

    Friday, March 18, 2011 1:58 AM
  • User-481631678 posted

    See this link, it will guide you that what are different places where you can set session time out:-


    Maximum value of session timeout is one year.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 18, 2011 6:06 AM
  • User-1011137159 posted

    if you want to maintain session longtime mean 5-6 hours then I suggest go with SQL server session mode...

    Here session stored in sql server so you can preserver as long as you want.


    Friday, March 18, 2011 6:18 AM
  • User256534580 posted

    thanks a lot

    Saturday, March 19, 2011 7:57 AM
  • User-481631678 posted

    is your problem solved? if yes then kindly mark one or more posts as answered which helped you.

    Sunday, March 20, 2011 4:38 PM