Why cookies dont expire after closing browser?

前端 未结 8 649
一整个雨季
一整个雨季 2020-12-14 22:31

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

相关标签:
8条回答
  • 2020-12-14 23:25

    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

    0 讨论(0)
  • 2020-12-14 23:33

    There are two major kinds of cookies. Session and Persistent cookies.

    Session cookies are usually removed when you close the browser. Session cookies are usually used for keeping track of login information, shopping carts etc.

    Persistent cookies are also called tracking cookies. They are often used by advertisers to track what ads you have already watched. It is also used for some web pages to remember information about you, such as automatic login and auto-filling forms with commonly used details (such as your login name). Persistent cookies are removed when max age or expiration date have been reached.

    More information regarding different cookie types can be found on Wikipedia - HTTP cookie.

    0 讨论(0)
提交回复
热议问题