cookie丢失
[NullReferenceException:
未将对象引用设置到对象的实例。]
------解决方案--------------------HttpCookie MyCookie = new HttpCookie("LastVisit");
DateTime now = DateTime.Now;
MyCookie.Value = now.ToString();
MyCookie.Expires = now.AddHours(1);
Response.Cookies.Add(MyCookie);
要设置cookie的过期时间,不然下次浏览器关闭后自动过期