6
爲什麼這個cookie不保存在我的global.asax的Session_Start方法中?ASP.NET MVC cookie不保存?
//new anon user:
var authCookie = new HttpCookie("user-id", string.Format("{0}-{1}", regiserAccountResponse.UserName, regiserAccountResponse.Key))
{
Expires = DateTime.MaxValue,
Domain = "domain.com",
Secure = true,
HttpOnly = true
};
//create the new users cookie - there's no need to call RegisterNewUserSession as this is done in the same call
HttpContext.Current.Response.SetCookie(authCookie);
你是如何檢測是否它實際保存?有你是否使用過Wireshark來查看它是否會下降?你是否修復了域名並保護位以反映現實? – 2010-11-26 13:51:40
我應該保留域名爲空,直到我準備好部署?或者它應該是本地主機,直到我部署? – iwayneo 2010-11-26 13:54:08