document.cookie property writes a cookie to the web browser.
Note: Though you set a String value to the
document.cookie property, when you read it out again, you can only see the key-value pair of it.
Write Single Cookie
In the following example, we will write a single cookie (username).
Write Multiple Cookies
There are no shortcuts to write multiple cookies, you have to set
document.cookie property multiple times.
Write Object Cookie
To write an object to a cookie, you have to convert that Object to a String and then store it.
Please do google search for:
Join Our Channel
This channel is primarily useful for Full Stack Web Developer.