DEV Community

hxrshxd
hxrshxd

Posted on

What is a cookie? (website)

Cookies were introduced to store data. Cookies are used to store information on the client system. Cookies are sent to the server with the request and to the client in response, therefore cookies are sent to the server with every request.

Cookies aid in providing a better user experience and tailored content to the user. Cookies can be created, updated, or read using JavaScript: document.Cookies .

Cookies are classified into two categories.

a) Session cookies
They do not have any special properties such as Expire or Max Age. When the user exits the browser, they are removed.

b) Persistent cookies
They have specific properties such as Expire or Max Age. They are not removed when the browser is closed, but rather when specific attributes are met.

source : here

That's all to this article.

If this article was helpful to you, make sure to send this to your friend or someone who might need and follow me on twitter @Hxrshxd for more.

Top comments (0)