Cookie missing when called in a class

Djanggo

New Member
Good day..! I have some issue getting the value of my cookie when called in a class.. here's my code in my default.aspx.. I can retrieve the value on the when inside the aspx page\[code\] HttpCookie myCookie = new HttpCookie("SAMPLE"); myCookie["value"] = HttpUtility.UrlEncode(value); myCookie.Expires = DateTime.Now.AddDays(1d); Response.Cookies.Add(myCookie); if (Request.Cookies["SAMPLE"] != null) { string userSettings; if (Request.Cookies["SAMPLE"]["value"] != null) { userSettings = Request.Cookies["SAMPLE"]["value"]; } }\[/code\]But when i called the cookie inside a class using this code HttpUtility.UrlDecode(HttpContext.Current.Request.Cookies["SAMPLE"]["value"]) it doesn't have any value.. Any idea..? Hope to hear from you soon.. Regards, Link
 
Back
Top