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.