Features


Monday, May 26, 2008

How to store and retrieve cookie C#

cookie["Name"] = "Kiko Salva"
cookie.Expires = DateTime.Now.AddYears(1);
Response.Cookies.Add(cookie);

// To retrieve

lblName.Text = "Cookie Created.";
lblName.Text += "New Customer: " + cookie["Name"];

No comments: