title: Js cookies : SyntaxError: missing ) after argument list
body: <p>The error is thrown when i set a cookie with a date :</p>
  
  <pre><code>var COOKIE = {
  
      setCookie: function(name, value, expdate) {
          'use strict';
  
          var str = encodeURIComponent(name) + '=' + encodeURIComponent(value);
          str +=';expires=' + expdate.toUTCString();
          alert("in");
          console.log(expdate.toUTCString());
          document.cookie = str;
      } // End of setCookie() function
  
  };
  
  window.onload = function() {
      'use strict';
     COOKIE.setCookie('username', 'John', Mon 29 Aug 2016 11:40:00 UTC ); // date
  };
  </code></pre>
  
  <p>But it doesn't if i use a number of days : </p>
  
  <pre><code>var COOKIE = {
  
      setCookie: function(name, value, numdays) {
          'use strict';
  
           var cookieDate = new Date();
         cookieDate.setDate(cookieDate.getDate() + numdays);
  
          var str = encodeURIComponent(name) + '=' + encodeURIComponent(value);
          str +=';expires=' + cookieDate.toGMTString();
          alert("in");
          console.log(cookieDate.toGMTString());
          document.cookie = str;
      } // End of setCookie() function
  
  };
  
  window.onload = function() {
      'use strict';
     COOKIE.setCookie('username', 'John', 1 ); // day
  };
  </code></pre>
  
  <p>I respected the format expected by official doc. What's going on here?  Thanks,</p>