public void CookieWrite(string key, string value)
{
if (String.IsNullOrEmpty(value) == true)
{
this.CookieDelete(key);
return;
}
HttpCookie c = Request.Cookies["UserSettings"];
if (c == null) c = new HttpCookie("UserSettings");
c.Values[key] = value;
c.Expires = DateTime.Now.AddMonths(1);
c.Path = "/";
Response.Cookies.Add(c);
}
public void CookieDelete(string key)
{
HttpCookie c = Request.Cookies["UserSettings"];
c.Values.Remove(key);
c.Expires = DateTime.Now.AddMonths(1);
c.Path = "/";
Response.Cookies.Add(c);
}
public string CookieRead(string key)
{
HttpCookie c = this.Request.Cookies["UserSettings"];
if (c == null) return null;
return c[key];
}