这个是一个快速的:
cookie名称和值中允许的字符是什么?它们与URL或某些常见子集相同吗?
我要问的原因是,我最近发现了一些奇怪的行为,其中包含-
名称中的cookie,我只是想知道它是否是浏览器特定的,或者我的代码是否有问题.
我在 Flask 中设置了一个 cookie,如下所示:
response.set_cookie('notice', value = json.dumps(someObject), max_age=None)
Run Code Online (Sandbox Code Playgroud)
如果我在服务器上打印 json.dumps(someObject) 我得到:
{"message": "hello", "type": "success"}
Run Code Online (Sandbox Code Playgroud)
在客户端它变成:
"{\"message\": \"hello\"\054 \"type\": \"success\"}"
Run Code Online (Sandbox Code Playgroud)
我想在 javascript 客户端上解码它到底是什么格式?
我想对其进行解码并将其传递给 angular.fromJson(),看起来至少有(\"的)未转义要做,但我很惊讶地看到 \054(用于逗号)