title: Setting multiple cookies in Javascript
body: <p>I'm trying to set multiple cookies in <code>document.cookie</code>, but unfortunately only one is getting added.</p>
  
  <p>I know there are multiple examples present on the 'Net for setting up these kind of cookies,and I followed one of them. But still I'm unable to set that out.
  I followed this <a href="http://www.elated.com/articles/javascript-and-cookies/" rel="noreferrer">link</a>  to set my cookie.</p>
  
  <p><strong>My Code:</strong></p>
  
  <pre><code>   function setCookie(start_time,end_session_time,total_time,flag,count){
       var cookie_string = "start_time="+start_time;;
  
      if(end_session_time) {
          cookie_string +="; end_session_time="+end_session_time;
      }
  
      if(total_time){
          cookie_string +="; total_time="+total_time;
      }
      if(flag){
          cookie_string +="; flag="+flag;
      }
      if(count){
          cookie_string +="; count="+count;
      }
  
      document.cookie =cookie_string ;
      console.log(cookie_string);
  
      console.log("document.cookie ="+ document.cookie);
  }
  </code></pre>
  
  <p><strong>The Output:</strong></p>
  
  <pre><code>cookie_string :: start_time=1369926508266; flag=1; count=1
  document.cookie =start_time=1369926508266; 
  </code></pre>