title: How to get session data (from external php script) without being overwritten by Joomla session?
body: <p>When I include the Joomla framework, the Joomla session seems to be overwriting the session that I am using in another script.
  <strong>How can I get information from the first session AND from Joomla?</strong></p>
  
  <p><strong>DETAILS</strong></p>
  
  <p>I started a session in a php script external to Joomla.</p>
  
  <p>That file is  file1.php</p>
  
  <pre><code>&lt;?php 
      session_start();
      $qid[0]=1;
      $qid[0]=2;
      $qid[0]=3;
      $_SESSION['qid']=$qid;
  ?&gt;
  </code></pre>
  
  <p>I then have a php script called main.php It includes 2 files, getsessdata.php and getjoomla.php</p>
  
  <p>main.php</p>
  
  <pre><code>&lt;?php 
      include("getsessdata.php"); 
      include("getjoomla.php"); 
  ?&gt;
  </code></pre>
  
  <p>I can get the session data from main.php if getjoomla.php is not included.</p>
  
  <p>var_dump($_SESSION);    Shows that the session data for qid is missing when getjoomla.php is included.</p>
  
  <p>getsessdata.php</p>
  
  <pre><code>&lt;?php 
      session_start();
      $qid=$_SESSION['qid']; 
  ?&gt;
  </code></pre>
  
  <p>getjoomla.php</p>
  
  <pre><code>&lt;?php
     define( '_JEXEC', 1 );
     define('JPATH_BASE', dirname(__FILE__));   
     define( 'DS', DIRECTORY_SEPARATOR );   
     require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
     require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
     require_once (JPATH_BASE.DS.'libraries'.DS.'joomla'.DS.'environment'.DS.'request.php');
  
     $mainframe =&amp; JFactory::getApplication('site');
     $mainframe-&gt;initialise();
  ?&gt;   
  </code></pre>
  
  <p><strong>QUESTION:</strong> </p>
  
  <p>How can I access the session information from file1.php and still access data from getjoomla.php ? Why am I losing the information from the first session?</p>
  
  <p>Not sure if this helps, but once I have the session data from file1 in main.php the session is no longer needed.</p>