I need to set a cookie with javascript which I'm doing this with the following command:
document.cookie = name+"="+value;
My problem is that value
is a string, which can contain any unicode-character.
Is there a function which automatically replaces special characters (like ;
) - and if not, which characters are forbidden?
Something like the "encodeURIComponent()"-Function for Get-Parameters would be perfect