Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How does sessions work in a server?

Is it correct that after closing the browser and re-opening intermediately the sessions be restored? What about closing and re-opening a tab (where the session would be the same)?

Is it correct that different browsers from the same client have different sessions? Even private mode of browser has different sessions that "regular mode"!

I know this are lots of questions. I'd like some good source to read about how do sessions work so I can answer the other question myself. (Still if anyone has something to say about the others question I'll also be grateful.

share|improve this question

migrated from Dec 13 '10 at 17:29

This question came from our site for system and network administrators.

Closing. Either an end user question ( or a programming related question (, but whatever it is - is not a dump for questions not related to server administration. – TomTom Dec 13 '10 at 16:31

depends how the cookie is setup. Most sessions are tied to a cookie that is on your computer. The cookie can have a lifetime of minutes to days or just the lifetime of the browser. I think if you close a tab that counts as the lifetime of the browser.

share|improve this answer
@Mike - Can you please post a link so I can read some more about it the "cookies on the computer". Right now closing a tab does not kill the cookies (at least with the site I'm trying). Thanks for the answer! – Diego Dec 13 '10 at 13:47
They probably set a certain lifetime for the cookie – Mike Dec 13 '10 at 13:49

Server sessions are managed by the web server. Session state is used for storing the user's object state, so you can request the server without having to login every-time (if your web application requires authentication). Storing objects in the server between callings, from client to server is used some times for passing data between pages. Session state is one of the scopes the server has for storing object in memory: request, page, session, application.

In ASP.Net session state depends on which mode your application is running: in process mode, out of process mode, sql server mode.

Because the dis-connected state nature of web applications there is required some manner for maintaining the Session ID, this is where cookies are used. In ASP.Net you can use cookie-less state, in this case the session ID is transfered in the URL each time you do a request to the server. Every cookie has an expiration time. In all this configuration take place in some XML file named web.config.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .