title: PHP session cookies to expire when browser closes
body: <p>I am working in Wordpress and have the following in my functions.php page.</p>
  
  <p>I have an array of 3 different styles. My cookie is doing the randomizing.</p>
  
  <pre><code>if (isset($_COOKIE['style'])){
      $style = $_COOKIE['style'];
  }
  else {
      $style = ($rand[$stylearray]);
      setcookie('style',$style,time(),COOKIEPATH,COOKIE_DOMAIN,false); 
  }
  </code></pre>
  
  <p>I want to set it so that my cookie <strong>ONLY</strong> expires when browser closes.
  However, it seems that on page refresh(F5) the cookie expires.</p>
  
  <p>Is there a way to set it so that my cookie only expires on browser close?</p>