title: cookie value in php dosen't change
body: <p>I have a big problem in changing cookie value. I have buttom function to change(if exist)/create(if !exist) cookie and set value for it.</p>
  
  <p>When i call function the session value changed, but not happened any change in cookie data.</p>
  
  <pre><code>function setToken($time = 0) {
    global $value;
    if (!isset($_COOKIE["name"])) {
      setcookie("name", $value, time() + $time);
    } else {
      $_COOKIE["name"] = $value;
    }
    $_SESSION["name"] = $value;
  }
  </code></pre>
  
  <p>What's wrong &amp;&amp; What's should i do???</p>