title: storing javascript array with special characters inside a cookie
body: <p>i searched around stackoverflow and found out that cookie only can store string not array.</p>
  
  <p>i have an array like this:</p>
  
  <pre><code>  var myvar = {
     'comment' : '123',
     'blog' : 'blog',
     'test' : '321
    }
  </code></pre>
  
  <p>Then i use this jquery plugin to manage the cookies: 
  <a href="https://github.com/carhartl/jquery-cookie/blob/master/jquery.cookie.js" rel="nofollow">https://github.com/carhartl/jquery-cookie/blob/master/jquery.cookie.js</a></p>
  
  <p>I use the below code to store the cookie named 'setting':</p>
  
  <pre><code>  $.cookie('setting',  myvar , { expires: 1, path: '/' });
  </code></pre>
  
  <p>However how do i convert that array into a string , i know i can use .join , but what if my array values for example comment , is a special character like Chinese characters etc.</p>
  
  <p>and how can i access the cookie again and get the string out and convert it again into an array?</p>