'Create cookie containing ";" character

I want to create a cookie that it's value contains many ";" characters that is usually used to separate multiple cookies in java, that's why my code isn't making his job. if someone can help me how to create this "special" cookie and make my code work? thanks.



Solution 1:[1]

Semicolon is not allowed in cookies. Your best shot is to use some other separator. Read the linked answer to figure out what character can be used.

Solution 2:[2]

You can use URL encoding to escape any special characters (+, %, =, ;).

The URL encoded value of ; is %3B.

For a better reference, check out the Java JSON API.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Community
Solution 2 Ian Bishop