Session Expired after closing browser when using State Server

3.3k views Asked by At

i have a very simple question I m using State Server for storing Session in my application. The problem is that, when i hit my site and login in my site and after i login if i close my browser and reopen again thne my session is lost. I have to login in again. What is minimum do i have to do for making session alive even aftre closing browser.

My state server configuratin is below

 <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" />

and in my globel.aspx file on sesion_start i m doing this

// set the session timeout 20Minutes
    Session.Timeout = ConfigurationManager.AppSettings["SessionTimeOutTimeInMinutes"].ToInt32Safe();

What is minimum do i have to do for making session alive even aftre closing browser.

My State Server Sesstion

Here is image of my settings on sever

1

There are 1 answers

1
Ian Gilroy On BEST ANSWER

ASP.NET Session state uses non-persistent session cookies that (by design) do not survive when you close your browser. If you want persistent session state you need a means of making the ASP.NET session cookie persistent.

There are some examples out there. For example: