0

In my web application , i have set session time out for 60 minute in the web.config file inside system.web tag, however it is not working. After 30 minute its session get expired. please look into my code below and help me.

<system.web>
  <customErrors mode="Off">
</customErrors>
    <authentication mode="None" />
    <compilation targetFramework="4.5.2" />
    <httpRuntime targetFramework="4.5" />
     <caching>
      <outputCacheSettings>
        <outputCacheProfiles>
          <add name="CacheOneDay" duration="86400" varyByParam="IFAID" />
        </outputCacheProfiles>
      </outputCacheSettings>
    </caching>
<sessionState timeout = "60" mode = "InProc" />
  </system.web>
1
  • check your global.asax file. If there is a timeout set in there it will override the web.config setting Commented Dec 7, 2018 at 9:55

1 Answer 1

1

There are 3 ways session timeout can be set:

  • You can increase the time out value in minutes using the timeout attribute of sessionState element in web.config.

  • You can set it in code

    Session["UserId"] = 1234;
    Session.Timeout = 60;

  • If you are using forms authentication, check the authentication time out value as well.

You have already checked and applied the first item. You can search for Session.Timeout in your solution or if you are using forms authentication check for it's timeout variable.

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

1 Comment

where should i write the "Session.Timeout = 60" in my web-config or Code behind?

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.