Professional Documents
Culture Documents
Type of Cookies?
1. Persist Cookie - A cookie has not have expired time Which is called as Persist Cookie
2. Non-Persist Cookie - A cookie has expired time Which is called as Non-Persist Cookie
Its really easy to create a cookie in the Asp.Net with help of Response object or HttpCookie
Example 1:
Example 2:
Response.Cookies["userName"].Value = "Annathurai";
Response.Cookies["userColor"].Value = "Black";
Its easy way to retrieve cookie value form cookes by help of Request object.
Example 1:
Example 2:
When we make request from client to web server , the web server process the request and
give the lot of information with big pockets which will have Header information, Metadata,
cookies etc., Then repose object can do all the things with browser.
5. Expires => Which is used to set expire date for the cookies.
Advantages of Cookie:
4. Fast accessing.
Disadvantages of Cookie
2. No security.