Update and delete cookies

Описание к видео Update and delete cookies

Link for all dot net and sql server video tutorial playlists
   / kudvenkat  

Link for slides, code samples and text version of the video
http://csharp-video-tutorials.blogspo...

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
   / @aarvikitchen5572  

In this video we will discuss
1. Updating a cookie
2. Deleting a cookie
3. Cookie limitations

Updating a cookie : To update a cookie, set a cookie with the same name again. The following code updates the color cookie with the New_Color if a cookie with name=color exists otherwise it creates a new cookie with that name.
document.cookie = "color=New_Color";

Deleting a cookie : To delete a cookie, set a cookie with max-age attribute set to a negative value
document.cookie = "color=red;max-age=-60";

If you are using a browser that supports expires attribute, then set the expires attribute to a date in the past.
document.cookie = "color=red;expires=Mon, 01 Jan 1900 01:00:00 UTC;";

Please note: Users can also use the browser interface to delete cookies anytime they want.

Cookie limitations :
1. What is the maximum allowed cookie size per cookie
2. How many cookies are allowed per domain

The answers to these questions really depend on the browser you are using. The following website can be used to find out what the limits are
http://browsercookielimits.squawky.net

Комментарии

Информация по комментариям в разработке