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

I have got a basic question: Lets say for example I log in to my Google account and tick the box that says "Stay signed in". Then, obviously, I stay logged in even if I close my browser.

So, this means that some kind of information has to be stored on my PC. Can someone explain me what exactly happens here and how all this works. Thanks in advance!

share|improve this question

migrated from Oct 28 '12 at 23:45

This question came from our site for professional and enthusiast programmers.

Cookies. Nom nom. – Greg Hewgill Oct 28 '12 at 21:50
up vote 2 down vote accepted

A small cookie file gets stored on your machine per site that contains a session ID to identify you. The website checks your cookie file to retrieve you session ID and then queries it against a database (server-side) to check for your credentials and see if your session is still active. The Keep me signed in means the session doesn't expire when the browser closes. A cookie table in the datebase might look something like this.

Session ID  | USER | Expires

DSGW352355F   BOB   12.00 01/01/1970   
...           ...   ...  

So you see only the session ID is stored on your local machine and your personal details are stored severside. If you login to the same website in two different browsers on your machine each will have a different session ID and corresponding entries in the database and by loggin out you remove the entry in the database, hence no longer being logged in.

share|improve this answer

You tagged this with 'cookies' so you seem to know what cookies are... Well, the server, after the successful authentication, sends back a session cookie (with a unique, let's say "secret" key inside) to your browser, which stores the cookie. Next time the browser will automatically send the info (key) stored in the cookie back to the website, which will verify that and let you in without the need for typing the password again.

share|improve this answer

This information is stored in cookie in your browser (thus if you use another one, you won't be remembered them). But this is not your password what is stored - only a hash that lets the server recognize you.

share|improve this answer

You must log in to answer this question.