Click here to Skip to main content
15,896,387 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I am working on a project. The problem is the session not expired . I have set the Session in Web.Config but still the session not expired . I have set it to 10 minutes . Here is my web.config
C#
<sessionState timeout="10" mode="InProc"
      cookieless="false"></sessionState>


and this is my setting in Global.asax file under Session_Start method
C#
Session.Timeout=10;
Posted
Comments
londhess 30-May-14 1:23am    
You would have to setup session timeout in your IIS.

OR else try this link

http://www.codeproject.com/Articles/113287/Why-Session-Timeout-is-not-working-for-your-websit

1 solution

Have you handled what to be done after the expiration of the session ?

Generally after session expired it should be moved to login page on performing any operation on page.See this configuration to work as expected :-

HTML
<system.web>
      <sessionstate timeout="1" />
      <authentication mode="Forms">
        <forms loginurl="~/Login.aspx" defaulturl="~/Home.aspx" slidingexpiration="true" timeout="1"></forms>
      </authentication>
      <compilation debug="true" targetframework="4.5" />
      <httpruntime targetframework="4.5" />
    </system.web>


The page will automatically be redirected to Login page if you will try to do any operation after session expiration.

Please let me know if this works for you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900