I can open a console in any web document and write the following:
document.cookie = '()<>@,:\"/[]?{}=Value{"hello":1}'
Then, when I check my cookies (either in the dev tools or by calling document.cookie again, the value is there, even though according to RFC 6265, as well as cookie docs on MDN, the names and values are invalid.
So is that a valid cookie or not? If that cookie invalid, why does document.cookie accepts it as if it was valid?