Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what are persistant cookies? How long do they exist?

Tags:

cookies

I heard cookies are stored in my browser. But what are persistant cookies? Where they are stored? What is the use of those cookies?

like image 572
giri Avatar asked Feb 27 '23 18:02

giri


1 Answers

A persistent cookie is one that remains on your machine past the point of session expiration. It is stored on disk, and used for websites to remember you (or other information about you, or other information it deems necessary to store) between visits. For example, this is how Amazon knows who you are even if you shut down your machine and come back another time.

These are the cookies that get removed when you access your browser's preferences and select the "delete cookies" option.

Usually persistent cookies are created by setting an expiration date on the cookie, so that the browser doesn't remove it at the end of the session by default.

Also, it's not quite right to say that cookies are stored "in the browser". A browser is just a running application, which may load cookie data into memory when it needs to. All cookies are stored in the same space; what makes a cookie persistent is just whether it gets removed when your session is over.

like image 100
danben Avatar answered Mar 02 '23 08:03

danben