I'm looking for a good example of storing data in a cookie using ASP.NET. Could someone show me an example?
Exactly what part of that link had anything at all to do with .Net?
Chris Lively
2009-04-30 20:36:45
+6
A:
MSDN is quite your friend : http://msdn.microsoft.com/en-us/library/78c837bd.aspx
Until then :
C#:
Response.Cookie["cookie_name"] = "value";
VB:
Response.Cookie("cookie_name") = "value";
Erick
2009-04-30 20:24:41
Please update answer with this link, http://msdn.microsoft.com/en-us/library/78c837bd.aspx. Site is only in en-US right now.
rick schott
2009-04-30 22:38:54
+2
A:
How to Create a cookie
HttpCookie mycookie = new HttpCookie("mycookie");
mycookie.Value = "chocolate chip please.";
Response.Cookies.Add(mycookie);
How to Read a cookie
HttpCookie mycookie = Request.Cookies["mycookie"];
Response.Write("Your cookie is: " + mycookie.Value);
Chris Lively
2009-04-30 20:35:45