我是如下这样写的:
HttpCookie cookies = new HttpCookie("source");
protected void Page_Load(object sender, EventArgs e)
{
if (cookies["source"] == null)
{
result = "Cookies 1";
cookies["source"] = "pc";
cookies.Domain = "www.testdomain.com";
cookies.Expires = DateTime.Now.AddMinutes(30);
HttpContext.Current.Response.Cookies.Add(cookies);
}
else
{
result = "Cookies 2";
HttpContext.Current.Response.Write(cookies["source"].ToString());
}
}
现在我想知道应该如何让它持久化,因为当我关闭浏览器或者让这个页面默认跳转到另外一个网站(即另外一个域)后,我无法拿到Cookie