HttpCookie newCookie = Request.Cookies["cookie1"];
 int count = (newCookie .Values.Keys.Count) / 6;
 int keyCount = (newCookie .Values.Keys.Count);
 string val = HttpUtility.UrlDecode(newCookie .Values.GetKey(i).ToString());
 string str = newCookie .Values.GetKey(i).ToString();

 // i is loop counter


我想使用javascript cookie,有什么办法可以从上述C#代码中使用javascript中的相同代码?

最佳答案

尝试喜欢

 Set Cookie : document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 GMT";
 Get Cookie : vat x = document.cookie ;

07-24 18:12