一个类里面方法操作public static void SteCokies(string name,string value,doble tim)
{
HttpContext.Current.Response.Cookies[name].Value = value;
HttpContext.Current.Response.Cookies[name].Expires = System.DateTime.Now.AddDays(tim);
}
public static string GetCokies(string name)
{
retirn HttpContext.Current.Response.Cookies[name].Value
}这时候来了一个人他不知道上面方法的存在
于是就在page里面写了Response.Cookies["name"].Value = "asdfas";
Response.Cookies["name"].Expires = DateTime.Now.AddDays(1);这时候出现了一个问题
我们操作同一个cokie
我用GetCokies读取没问题
但是当他用Request.Cookies["name"].Value读取后
我在GetCokies读取对象为“”
然后紧接着她在Request.Cookies["name"].Value
就出现了未将对象引用到对象实例
请问这个是怎么回事