user1504712
user1504712

Reputation: 33

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.

Upvotes: 3

Views: 5225

Answers (2)

Ian Bishop
Ian Bishop

Reputation: 5205

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.

Upvotes: 5

Hari Menon
Hari Menon

Reputation: 35405

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.

Upvotes: 4

Related Questions