cookie取不到值,帮忙看看
萬里無雲 2010-05-18 04:27:37
在login.aspx页面点按钮
protected void btnLogin_Click(object sender, ImageClickEventArgs e)
{
HttpCookie cookie = new HttpCookie("COOKIES_USERINFO");
cookie.Value = "aaa";
cookie.Expires = System.DateTime.Now.AddYears(1); //1年
cookie.Path = string.Empty;
Response.Cookies.Add(cookie);
Response.Redirect("~/index.aspx");
}
在index.aspx页面Page_Load取值
Response.Cookies["COOKIES_USERINFO"].Value
为空
哪里有问题吗?IE设置cookie是可用的。