3

I have checked various questions asked in SO in this topic also tried the solutions provided for the various questions, but it doesnt work for me. My application is ASP .Net4.5, I store username, usertype in session and later it is used while inserting data to the SQL tables. I have set the session time out in webconfig as follows.

  <system.web>
      <authentication mode="Forms">
        <forms loginUrl="Login.aspx" name=".mycookie" timeout="60"></forms>
  </authentication>
<sessionState mode="InProc" cookieless="false" timeout="60" />

In the IIS settings against Sessionstate the following were set

SessionState = In Process
Cookie settings -> Mode = Use Cookies
                   Name = ASP.Net_SessionId
                   Timeout (min) = 60

I'm not sure whether I'm setting this in wrong way in the above settings. The issue is my application session timeouts much before the set time, I feel it gets timeout in 10-15 minutes. Please advise how to set the timeout value correctly.

Shah
  • 106
  • 6
  • https://stackoverflow.com/questions/1205828/how-to-set-session-timeout-in-web-config – Anil Nov 29 '17 at 06:40
  • @Anil, My webconfig file already has the values mentioned in your reference, but still it doesnt work. – Shah Nov 29 '17 at 07:10

3 Answers3

0

Probably, you are getting problem with form authentication timeout and session timeout. Please see here.

Mike
  • 721
  • 7
  • 13
0

Try this in web config file.

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

    <sessionState timeout="60"  />
</system.web>
Revathi Vijay
  • 1,238
  • 1
  • 13
  • 25
0

I tried setting session timeout, but it didnt worked for me. I decided to store those session variables used in cookies, and read from cookies. Now there is no session timeout issue. I clear the cookies while login to the application, also set the expiry to 1 day to avoid any issue. Thanks for helping me.

Shah
  • 106
  • 6