Cookies are data, stored in small text files , on your computer. Web Browsers and Servers use HTTP protocol to communicate and HTTP is a stateless protocol . When a web server has sent a web page to a browser, the connection is shut down, and the server forgets everything about the user. But for a commercial website, it is required to maintain session information among different pages. In order for it to remember users information, cookies are used.
Cookies are stored in the computer in name-value pairs.
Add an expiry date (in UTC time)
With a path parameter, you can tell the browser what path the cookie belongs to. By default, the cookie belongs to the current page.
Read a Cookie
Change a Cookie
Delete a Cookie
- What is noscript tag?
- Difference between '=', '==' and '===' operators?
- What is Browser Object Model
- How to test a string as a literal and as an object ?
- What is Associative Array? How do we use it?
- What's the Difference Between Class and Prototypal Inheritance?
- Event bubbling and Event Capturing in JavScript?
- What is the difference between .call() and .apply()?
- What is an immediately-invoked function expression?
- What Are RESTful (REpresentational State Transfer)Web Services?