Reputation: 1817
I've tried sending cookies like "test[]=111" to Java servlets, and the systems (Tomcat, Jetty) ignore the cookie and do not populate it.
The same cookie is valid on a PHP system and also on the browser. Is "test[]" a valid cookie name? Or if so, since most browsers seem to support it, why is it ignored on Java servlets?
Upvotes: 0
Views: 34
Reputation: 19445
According to RFC-6265, a cookie name is a token
.
RFC-2616 defines a token
as:
token = 1*<any CHAR except CTLs or separators>
separators = "(" | ")" | "<" | ">" | "@"
| "," | ";" | ":" | "\" | <">
| "/" | "[" | "]" | "?" | "="
| "{" | "}" | SP | HT
Your cookie name is invalid as []
fall into the "separators" category.
Upvotes: 2