I am using this code to set cookie. It is working perfectly in Firefox. but not in IE9.
Below is the code:
HttpCookie visitorCookie = new HttpCookie("VisitorCity", DdlCity.SelectedItem.Text)
{Expires = DateTime.Now.AddMonths(1)};
HttpContext.Current.Request.Cookies.Add(visitorCookie); // Add it to the header
Normally when you want to set a cookie you should add it to the Response, not the Request:
It’s the client browser, when sending subsequent the HTTP requests, that will attach the cookie as a request header.