This content originally appeared on DEV Community and was authored by Nikhil Bobade
HTTP Cookies
HTTP cookies are known as a web cookie, Internet cookies, browser cookies. in the cookie, we can store a small piece of data that server send to your browser.
Cookies are useful for Auth cookie tokens, to store in small text files, user preferences, color themes, game scores for many things you can use HTTP cookies. Its very easy to create cookies and delete cookies with JavaScript, PHP, NodeJS & Python etc.
In cookies, we have many options like Expires, Domain, Path, Secure, Name they are used when we create a cookie or read a cookie.
1.Expire: we can use it to set the date the cookie will expire.
2.Secure: a browser only use HTTP.
3.Domain: The domain name of your site.
4.Path: The path to the directory or web page that set the cookie.
How to set cookies with JS?
For NodeJS, you need to require HTTP in your code and directly use cookies.
If you find this useful in a post like and save this post also comments about your thoughts. For more content follow me on Instagram @developer_nikhil27.
This content originally appeared on DEV Community and was authored by Nikhil Bobade
Nikhil Bobade | Sciencx (2021-05-28T14:14:19+00:00) What is Cookies All about HTTP(Part 2). Retrieved from https://www.scien.cx/2021/05/28/what-is-cookies-all-about-httppart-2/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.