title: send session var with php cUrl
body: <p>Am trying to send data between scripts within my application.</p>
  
  <p>Problem is session id is not responding.</p>
  
  <p>Script 1 is...</p>
  
  <pre><code> &lt;?php 
        session_start();
  
        $_SESSION['id'] = 1;
  
        $data = "data to be sent to script";
  
        $ch = curl_init("http:.../myscript.php");
  
        $nvp = "&amp;data=$data";
  
        curl_setopt($ch, CURLOPT_POSTFIELDS, $nvp);
  
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  
        echo curl_exec($ch);
  
        ?&gt;
  </code></pre>
  
  <p>myScript.php is... </p>
  
  <pre><code>      &lt;?php
  
        session_start();          
  
        $id = $_SESSION['id'];
  
        $data = $_POST['data'];
  
        $result = function idData($id, $data); // returns matching results.
  
  
        echo "Session Id = $id &lt;br /&gt;";
  
  
        echo "Id result = $result &lt;br /&gt;";
  
        ?&gt;
  </code></pre>
  
  <p>However myScript.php is not able to access the session data as per normal.</p>
  
  <p>Is there a work around for this? What could the possible cause be?</p>
  
  <p>Thanks</p>