locked
Session timeout is not working RRS feed

  • Question

  • User1053984062 posted

    Hi, 

      I set a session timeout at application level as well as IIS level around 20 hours but still it is taking as 20 minutes only.

    Kindly do needful.

    Thursday, February 25, 2016 11:40 AM

Answers

  • User-821857111 posted

     Once session timeout it moves to login page.
    Login is not managed by session. They are not related at all. If you want to extend your login timeout, you need to alter that in your web.config:

    <system.web>
        <authentication mode="Forms">
              <forms timeout="60"/>
        </authentication>
    </system.web>

    That sets the timeout for logins to 60 minutes.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 8, 2016 12:13 PM

All replies

  • User-471420332 posted

    Hi Girish,

             Where did you set the timeout? web.config or IIS management console? Set it in web.config if for an ASP.NET app. Also, you may have to set the app pool idle timeout to 9 hrs if using IIS 6.

    OR 

    There are some other timeout values that will affect session time out. One of them that comes to my mind is Worker Process Timeout(that is set from IIS). Worker Process's default time out is 20 mins, so if there is no activity in your site for 20 mins the worker process will end and causing your session to end if you are using session in InProc mode. So getting Worker Process's timeout value to 360 minutes is what you may need as well.

    Below are related links.

    http://forums.asp.net/t/1283350.aspx/1/10

    http://forums.asp.net/t/1283350.aspx

    http://www.brainbell.com/tutorials/ASP/Configuring_Session_State.html

    http://forums.asp.net/t/1750420.aspx?how+to+set+session+time+out+more+than+20+minutes

    Friday, February 26, 2016 6:45 AM
  • User-2057865890 posted

    Hi girish12206,

    The Timeout property can be set in the Web.config file for an application using the timeout attribute of the configuration element.

    The following code example sets the timeout session attribute to 30 minutes in the Web.config file.

    <configuration>
      <system.web>
        <sessionState 
          mode="InProc"
          cookieless="true"
          timeout="30" />
      </system.web>
    </configuration>
    

    To configure session timeout, you can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.

    Take a look at Configure Session Time-out (IIS 7)

    Best Regards,

    Chris Zhao

    Friday, February 26, 2016 6:55 AM
  • User1053984062 posted

    Hi,

      i did changes in web.config and IIS level(app pool).

    Friday, February 26, 2016 10:41 AM
  • User-471420332 posted

    hi girish12206,

       If you got answer means please mark as answer na.

    Friday, February 26, 2016 10:54 AM
  • User465171450 posted

    And keep in mind, the longer you keep session going the more pressure you are putting on the memory and garbage collection of the server. You aren't letting it get time to breath if you're attempting to keep the app loaded a long time. If you need to work with users over such a long period of time, then look at another mechanism such as Cookies or storing data in the database instead of the server's memory. If you store decently sized objects in session that long it's just asking for issues as the memory usage (and chance for leakage) increase.

    Saturday, February 27, 2016 2:14 AM
  • User1053984062 posted

    Hi,

       Sorry i tried all the ways but nothing worked.

    Monday, February 29, 2016 9:00 AM
  • User1053984062 posted

    Hi,

       I am using IIS8 .I have increased  session timeout at multiple places as below.

    1- App pool time out increased

    2- Asp.net --> Session state- time out increased

    3- Asp -- >Session Property -- time out increased

    4- management- Config Editor-  time out increased

    Monday, February 29, 2016 9:29 AM
  • User-1421834976 posted

    Hi Girish.

    Open IIS and click on your website, then go to session state menu. Check the session settings and cookie settings set the required session timeout and cookie timeout.

    Hope this will solve your problem. 

    Wednesday, March 2, 2016 6:46 AM
  • User-821857111 posted

    still it is taking as 20 minutes only
    How do you know this? What issue is it causing?

    Wednesday, March 2, 2016 8:18 AM
  • User1053984062 posted

    Hi Sridhar,

                     i already did it but still having same issue.

    Thanks

    Girish Rastogi

    Wednesday, March 2, 2016 9:58 AM
  • User-1363023537 posted

    May be you had configured wrong server.

    Wednesday, March 2, 2016 11:46 AM
  • User475983607 posted

    girish12206

    I set a session timeout at application level as well as IIS level around 20 hours but still it is taking as 20 minutes only.

    Maybe you are confusing Session with and ASP authentication framework like Forms Authentication.  

    Can you explain what problem you are experiencing? What happens when Session expires? Are you seeing errors or unexpected behavior?

    Friday, March 4, 2016 10:59 PM
  • User1053984062 posted

    Hi,

     Once session timeout it moves to login page.

    Tuesday, March 8, 2016 11:42 AM
  • User-821857111 posted

     Once session timeout it moves to login page.
    Login is not managed by session. They are not related at all. If you want to extend your login timeout, you need to alter that in your web.config:

    <system.web>
        <authentication mode="Forms">
              <forms timeout="60"/>
        </authentication>
    </system.web>

    That sets the timeout for logins to 60 minutes.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 8, 2016 12:13 PM
  • User1777983149 posted

    1) are you using Sql membership Form Athunticate if not the remove the
    this code 

    <system.web>
        <authentication mode="Forms">
              <forms timeout="60"/>
        </authentication>
    </system.web>

    and add below code

     <sessionState 
          mode="InProc"
          cookieless="true"
          timeout="30" />


    2) changes you website session state session  inside session timeout

    3)Changes you application pool ideal session timeout

    Monday, March 28, 2016 9:46 AM