title: IOS: javascript cookie not working on ios browsers like safari or chrome
body: <p>I'm working with js to store my shopping list in cookie.it works fine on windows or Macintosh or android mobiles but not working on iphone  mobile browsers(safari and chrome).in food page I add foods to my list and after refreshing the page or redirecting to other pages,cookie is empty.</p>
  
  <p>i've tried two ways to write the cookie and also played with cookie parameters but the problem is still there.</p>
  
  <p>here's my code to set cookie:</p>
  
  <pre><code>function bake_cookie(name, value) {
    var date, 
    date = new Date();
    date.setTime(date.getTime()+(30*24*60*60*1000));
    var cookie = [name, '=', JSON.stringify(value), '; domain=', "", '; 
    path=','/; expires='+date.toUTCString()+"';"].join('');
    document.cookie = cookie;
  }
  </code></pre>
  
  <p>my value is an array of objects like this:</p>
  
  <pre><code>[
    {
     count: 3
     food_id: 2
     kitchen_name: "kitchen 1"
     pic: "url"
     title: "food 1"
     total_price: 21000
     unit_price: 7000
    },
    {
     count: 5
     food_id: 7
     kitchen_name: "kitchen 2"
     pic: "url"
     title: "food 2"
     total_price: 25000
     unit_price: 5000
    },...
  ]
  </code></pre>
  
  <p>to update it first i delete the cookie like this:</p>
  
  <pre><code>function delete_cookie(name) {
    document.cookie = [name, '=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; 
    domain=', ""].join('');
  }
  </code></pre>
  
  <p>then I call bake_cookie() with new inputs.</p>