title: jQuery & set cookies using Ajax
body: <p>I am setting cookies using jquery+jquery cookie.</p>
  
  <pre><code>jQuery.cookie('status', 'active', {expires: 1, path: '/'});
  </code></pre>
  
  <p>Now how can I set this cookie using AJAX? regarless of jquery cookie, how would you set a cookie using ajax in jquery, anyone has any idea.</p>
  
  <p>Links to original question (<a href="https://stackoverflow.com/questions/18776850/php-jquery-passing-variables/18776984">PHP &amp; JQuery passing variables</a>)</p>
  
  <p><strong>update</strong></p>
  
  <p>So I am making the AJAX request like so in my jquery code</p>
  
  <pre><code>$.ajax({
      url:  "script.php",
      type: "GET",
      data: { status: active}
      });
  </code></pre>
  
  <p>And in my php I am processing it like;</p>
  
  <pre><code>if($_GET['status']!='')
  {
      setcookie("status", $_GET['status'], time()+3600);
  }
  </code></pre>
  
  <p>but nothing is happening, no cookie is being set. can anyone see the problem, </p>