Session Timeout Session Timeout

You can control the session timeout programmatically. Default it is 20 minutes and you can modify it inside web.config file of application.

Example of Session settings in Web.config file of application


  <sessionState timeout="50" />


On button click configure session timeout values.

public partial class _Default : System.Web.UI.Page

  protected void Button1_Click(object sender, EventArgs e)
     Session.Timeout = 30;

Session lost

By default, session get stored in worker process memory. On server if you have scenarios like WebGarden or WebFarm there are chances to get user session lost before timeout.

Read more here about Session state management


How are you using session variables in with C#.netIRequiresSessionState and SessionSessions In Interview Questions for 2 years or 3 years Session AbandonSession application viewstateSession Loss In WebgardenWhat is web garden in to implement Captcha in Asp.netasp net image upload


My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.

I'm Satalaj.