I'm trying to save the value of a textarea into a cookie using Javascript.
The problem comes when the user enters multiple lines. Only the first line is saved and subsequent directives are ignored.
e.g.
var myText = $('#mytextarea').val();
document.cookie = "mycookie=" + myText + "; path=/;"
if myText contains the \n character which it does if the user entered multiple lines in the textarea field, then not only are the rest of the lines not stored in the cookie, but the path=/; is ignored.
\\nin the string. Then when reading the cookie process it back from\\n=>\n