private void StoreCookie(string visitorId, string visitorName)
{
HttpCookie cookie = new HttpCookie("VisitorInfo");
cookie["VisitorId"] = visitorId;
cookie["Name"] = visitorName;
cookie.Expires = DateTime.Now.AddMinutes(3);
Response.Cookies.Add(cookie);
}
Retrieve Cookies
private void RetrieveCookie()
{
var cookie = Request.Cookies.Get("VisitorInfo");
var visitorId = cookie.Values["VisitorId"];
var name = cookie.Values["Name"];
}
No comments:
Post a Comment