Closed xuyang2 closed 10 years ago
The server (Jetty 7) double-quoted my cookie value internally because it contains '='.
Hey Xuyang,
Thanks for checking out the library! However, I consider this issue a "wontfix" - when you call Cookies.get
, you're getting the cookie-value
, not the cookie-octet
.
On a more practical note, someone has to lose out in this situation - if I update Cookies.js to automatically remove wrapping quotes, then it no longer becomes possible to legitimately have a literal quoted string as the cookie value. I prefer the current functionality of the library, as I believe it to be the more accurate/semantic choice.
As for a solution to your problem - you could see if there's a web server configuration setting you can change to prevent it from automatically wrapping cookie values in quotes (this seems like inappropriate behavior by the server to begin with), or alternatively, you could write some JavaScript to strip the quotes for you after you've gotten the raw value from Cookies.js.
according to rfc6265 (http://tools.ietf.org/html/rfc6265#section-4.1.1), cookie-value can be double quoted.
When a server send a cookie:
my brower (Chrome) got:
which is unexpected.