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.

2
  • stackoverflow.com/questions/1205828/… Commented Nov 29, 2017 at 6:40
  • @Anil, My webconfig file already has the values mentioned in your reference, but still it doesnt work. Commented Nov 29, 2017 at 7:10

3 Answers 3

0

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

Sign up to request clarification or add additional context in comments.

Comments

0

Try this in web config file.

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

    <sessionState timeout="60"  />
</system.web>

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.