/// <Summary>
/// Cookie operation
/// </Summary>
Public class Cookie {
Private Cookie (){}
Private static Cookie _ instance = new Cookie ();
Public static Cookie _{
Get {return _ instance ;}
Set {_ instance = value ;}
}
/// <Summary>
/// Add Cookie
/// </Summary>
/// <Param name = "key"> key name </param>
/// <Param name = "value"> key value </param>
/// <Param name = "hour"> storage time (hours) </param>
Public void SetCookie (string key, string value, string path, string domain, DateTime expires ){
HttpCookie hc = new HttpCookie (key );
Hc. Path = path;
Hc. Domain = domain;
Hc. Value = HttpUtility. UrlEncode (value );
Hc. Expires = expires;
HttpContext. Current. Response. Cookies. Add (hc );
}
/// <Summary>
/// Add Cookie
/// </Summary>
/// <Param name = "key"> key name </param>
/// <Param name = "value"> key value </param>
/// <Param name = "hour"> storage time (hours) </param>
Public void SetCookie (string key, string value, string path, string domain, int hour ){
SetCookie (key, value, path, domain, DateTime. Now. AddHours (hour ));
}
/// <Summary>
/// Add Cookie
/// </Summary>