tag:blogger.com,1999:blog-7209751425484679379.post4420874397066587657..comments2023-05-26T21:09:02.817+05:30Comments on Code.NET: Reading from CookiesUnknownnoreply@blogger.comBlogger1125tag:blogger.com,1999:blog-7209751425484679379.post-79188063426707888052009-01-23T16:28:00.000+05:302009-01-23T16:28:00.000+05:30Cookies are small files which are sent along with...Cookies are small files which are sent along with the pages. This is a commonly used clientside state management method. this is how we set cookies.<BR/><BR/>HttpCookie cookieName = new HttpCookie("myCookie");<BR/>cookieName .Expires = DateTime.Now.AddMinutes(60); Response.Cookies.Add(cookieName);<BR/><BR/>To delete cookies logically we make a cookie with the same name and set the expiration time to a date earlier than today. When the browser checks the cookie's expiration, the browser will discard the now-outdated cookie.<BR/><BR/>HttpCookie cookieName = new HttpCookie("myCookie");<BR/>cookieName .Expires = DateTime.Now.AddDays(-1); Response.Cookies.Add(cookieName);Anonymousnoreply@blogger.com