0

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

Community
  • 1
  • 1
user788592
  • 477
  • 1
  • 5
  • 12
  • I don't think that this is anything to do with how the session *state* is stored on the server side. The browser closing means that the session cookie is gone. – Damien_The_Unbeliever Aug 15 '12 at 08:03
  • so what should i do to avoid that – user788592 Aug 15 '12 at 08:07
  • Also keep in mind that in Asp.Net having a session and being logged in/authenticated are separate things. Usually a session is kept alive using a cookie. And authentication is also usually kept alive using a cookie. But they are different cookies, so you can lose you session while remaining logged in and vice versa. – user1429080 Aug 15 '12 at 08:52

1 Answers1

3

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:

Community
  • 1
  • 1
Ian Gilroy
  • 2,031
  • 16
  • 14