Home
C# ASP.Net Read Write Cookies
Simple Reminder for reading and writing cookies
using System.Web;
Writing
HttpCookie MyCookie = new HttpCookie("Keyf");
MyCookie.Value = "ThisValue";
MyCookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(MyCookie);
Reading
if (Request.Cookies["Keyf"] != null) {
string MyString = Request.Cookies["Keyf"].Value;
}
Reader's Comments
Name
Comment
Add a RELEVANT link (not required)
Upload an image (not required)
Uploading...
Home