Describe the bug
Cookie name with slash / character is escaped to %2F
Eg. user/123=foo becomes user%2F123=foo
I believe the forward slash character is allowed in the cookie key.
It's unclear why you're passing key here as the converter expects a single parameter:
value = converter.write(value, key)
And on the next line:
https://github.com/js-cookie/js-cookie/blob/b1d83a073525e00f87d8b4effa4804b8cb741f12/src/api.mjs#L21
Perhaps it would be better to have:
key = converter.write(key)
Expected behavior
Cookie name preserves the original forward slash character.
RFC 6265 defines the cookie name as token, which in turn is defined in RFC 2616 as follows:
token = 1*<any CHAR except CTLs or separators>
separators = "(" | ")" | "<" | ">" | "@"
| "," | ";" | ":" | "\" | <">
| "/" | "[" | "]" | "?" | "="
| "{" | "}" | SP | HT
So a / needs to be encoded.
Reopening as valid, see discussion in #595.
I've bumped the v3 beta containing the new implementation.
https://github.com/js-cookie/js-cookie/releases/tag/v3.0.0-beta.4
Most helpful comment
I've bumped the v3 beta containing the new implementation.
https://github.com/js-cookie/js-cookie/releases/tag/v3.0.0-beta.4