且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

asp.net和饼干特殊字符

更新时间:2023-02-15 23:20:38

&是在cookie中不是允许的字符。这是必要的EN code用的 UrlEn code 方法。

The ampersand is not an allowed character in a cookie. It's necessary to encode the cookie data with the UrlEncode method.

System.Web.HttpUtility.UrlEncode(cookie);

也看到这些做题/答案:

See also these SO questions/answers:

  • Broken string in cookie after ampersand (javascript)
  • How do you use an Ampersand in an HTTPCookie in VB.NET?