title: Magento session on custom php script not showing on phtml page - ajax
body: <p>I have some jQuery with ajax in an Magento phtml file which POSTs to an custom php script I have. What I want to do is create an Magento session in the custom php script which value is available in the phtml file where the ajax call is made.</p>
  
  <p>For example the phtml file (category list page) has the ajax call:</p>
  
  <pre><code>$.ajax({     
  type: "POST",     
  url: "/php/process.php",     
  data: dataString,     
  success: function(){       
  location.reload();
      }     
      });
  </code></pre>
  
  <p>Which successfully calls to my custom php script (process.php).</p>
  
  <p>process.php contains the following code for testing:</p>
  
  <pre><code>require_once ("/app/Mage.php");
  umask(0);
  Mage::app();  
  $returnedString= "123";
  Mage::getSingleton('core/session')-&gt;setMyValue($returnedString);
  </code></pre>
  
  <p>I have also tried this with session_start().</p>
  
  <p>Now in the phtml file to test the session is active I have the following test code:</p>
  
  <pre><code>if(Mage::getSingleton('core/session')-&gt;getMyValue()=='123'):
     echo "Session created";
  else:
     echo "Session not created";
  endif;
  </code></pre>
  
  <p>If I display the session array in the phtml file the session isn't visible as well. I'm not sure where I'm going wrong.</p>
  
  <p>Any help is greatly appreciated. Thanks in advance.</p>