Search code examples
sessioncookies

Why cookies dont expire after closing browser?


In books and tutorials related with Web-programming written that cookies expire when user close browser. So I cant understand why after closing browser(Opera) I can see the list of my cookies in "Parameters" window. And how sites (for example Facebook) identifier users after closing browser (session cookies must expire according to books and tutorials)?


Solution

  • Cookies are of two different types:

    • session cookies, held in memory, and which expire once the browser exits
    • persistent cookies, which have a time-to-live, are persisted on disk, and are sent by the browser until their time-to-live has elapsed.

    Read http://en.wikipedia.org/wiki/HTTP_cookie