如果您將Cookie的到期日期設置爲DateTime.Now.AddDays(-1),它何時會過期?它顯示過期是昨天。下面是代碼: var rememberMeCookie = new HttpCookie("remember_me");
rememberMeCookie.Expires = DateTime.Now.AddDays(-1);
當使用JSON字符串作爲值時,我遇到了一些使用Python的SimpleCookie的問題。 In [1]: from http.cookies import SimpleCookie
In [2]: cookie = SimpleCookie('x=1; json={"myVal":1}; y=2')
In [3]: cookie.keys()
Out[3]: dict_keys(['