Given a cookie x with a value 1 ..
Set-Cookie: x=1
.. a Message Authentication Code (MAC) y is added, in this case with a | delimiter.
Set-Cookie: x=1|y
How should the data, 1, and the MAC, y, be separated? Above, a delimiter is used, but this approach fails if the data could contain the delimiter. I considered using JSON,
{ "data": 1, "mac": "y" }
Which I believe would then have to be URL-encoded?
Set-Cookie: x=%7B%22x%22%3A1%2C%22mac%22%3A%22y%22%7D
Is there a standard for the format of cookie values that contain MACs?
The calculation of the MAC, y, should be irrelevant to this question. If necessary, please assume y is calculated using OpenSSL HMAC SHA-256.