我在C#中创建了cookie,它在localhost中工作得很好,但在实时服务器上不起作用,并且在实时服务器上没有显示cookie ...代码在下面
string currenturl = "/" + countrystate + "/" + city + "/" + HotelName + "?" + HotelIds;
currenturl = currenturl.Replace(" ", "-");
HttpCookie cookiecurrentpath =System.Web.HttpContext.Current.Request.Cookies["CurrentPath"];
if (cookiecurrentpath == null)
{
cookiecurrentpath = new HttpCookie("CurrentPath");
cookiecurrentpath.Value = currenturl;
}
cookiecurrentpath.Expires = DateTime.Now.AddDays(7);
this.ControllerContext.HttpContext.Response.Cookies.Add(cookiecurrentpath);