When you log into a web service like Yahoo the web server passes a tiny text file to your computer called a cookie. This cookie will contain a single string of information, usually a randomly generated authentication key from the server. The web server will also specify a time when that cookie is no longer valid.
If you open a new window and again access a Yahoo service the software running on the server will check if you already have an authentication key and that the key matches the one it has in the database for your session.
Cookies are browser specific which means if you have more than one browser on your pc (Chrome and IE for example) you can actually log in multiple times. This is the same as running the browser in privacy mode, all the cookies associated with account log in will be removed once the final privacy window has been closed.