关于COOKIE.....IE关闭就失效????
noall 2003-10-20 12:10:50
HttpCookie cookie=new HttpCookie("newcs");
cookie["user_id"]=userid1.Text;
cookie.Expires=DateTime.Now.AddDays(0);
Response.AppendCookie(cookie);
DIV1.InnerHtml="登录成功";
Response.Redirect("index.aspx");
在index.aspx的page_load中这样写
HttpCookie cookie=Request.Cookies["newcs"];
if (cookie!=null)
{
string s=cookie["user_id"];
if( cookie["user_id"]=="")
{
Response.Redirect("Login.aspx");
}
}
else
{
Response.Redirect("Login.aspx");
}
为什么我登录后COOKIE没有记住呢?IE并没有关闭,只有转向....
如果要让IE关闭就失效应如何设置呢?