title: Pass session cookies from javascript to php using ajax
body: <p>I would like to pass session variable from javascript. The problem that the Javascript itself was generated from PHP</p>
  
  <pre><code>echo "&lt;script&gt;"
  ."if(confirm('Evaluation is already exist! Do you want to update evaluation?'))
    {
      //Here I want to add : $_SESSION['confirmed']=1; so I can proceed to save process
      alert('Evaluation Saved!);
    }
    else
    {
       alert('Evaluation Cancelled!);
    }"
      ."&lt;/script&gt;";
  </code></pre>
  
  <p>How can I make this work ? Thanks in advance.</p>