dotjay / hashgrid

A little tool that inserts a layout grid in web pages, allows you to hold it in place, and toggle between displaying it in the foreground or background.
https://dotjay.github.io/hashgrid/
Other
446 stars 46 forks source link

Set valid cookies #10

Closed LoonyPandora closed 12 years ago

LoonyPandora commented 12 years ago

Some user agents choke or spew warnings when you have a cookie with a comma in the value. They may work, but I believe it's better to follow the spec and not cause potential problems.

According to RFC 6265 the cookie value should only contain "US-ASCII characters excluding CTLs, whitespace DQUOTE, comma, semicolon, and backslash" [1]

RFC 6265 is the most recent RFC regarding cookies, but the restriction on the use of commas goes back to the original netscape cookie spec. [2]

I've simply changed the commas to dashes, any other character will do.

[1] http://tools.ietf.org/html/rfc6265#section-4.1.1 [2] http://curl.haxx.se/rfc/cookie%5Fspec.html