title: Session variables not accessible in subdirectory
body: <p>When we moved our project from the beta test server to our live server we experienced the following:</p>
  
  <p>Session variables are only accessible if the file accessing them is in the same folder as the file that created them. This was not the case on our beta server. So I've created three very simple test files:</p>
  
  <p><strong>test.php</strong></p>
  
  <pre><code>&lt;?php
  session_id("581186accf44d7e80df40d0b5a47fb7d");
  session_start(); 
  $_SESSION['myvariable'] = 'Hello World';
  ?&gt; 
  &lt;html&gt;
      &lt;body&gt;
          &lt;p&gt;&lt;a href="page2.php"&gt;Same folder test&lt;/a&gt;&lt;/p&gt;
          &lt;p&gt;&lt;a href="test/page2.php"&gt;Subfolder test&lt;/a&gt;&lt;/p&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Then we have the following file duplicated in the same folder and in the test/ folder.</p>
  
  <p><strong>page2.php</strong></p>
  
  <pre><code>&lt;?php 
  session_start();
  print 'Here is page two, my session variable and my session cookie: '; 
  print $_SESSION['myvariable']; 
  print $_COOKIE['PHPSESSID'];
  exit; 
  ?&gt;
  </code></pre>
  
  <p>and here are the results:
  page2.php</p>
  
  <pre><code>Here is page two, my session variable and my session cookie: Hello
  World581186accf44d7e80df40d0b5a47fb7d
  </code></pre>
  
  <p>test/page2.php</p>
  
  <pre><code>Here is page two, my session variable and my session cookie: 581186accf44d7e80df40d0b5a47fb7d
  </code></pre>
  
  <p>As you can see, the session variable has disappeared. But the session ID cookie is preserved in the subdirectory, so it isn't a cookie issue.</p>
  
  <p>I've looked at the session block in phpinfo(); and aside from session.save_path, which is set on the beta server but not on the live server (which presumably means it will default to /tmp), the configuration is identical on both.</p>
  
  <p>Also, we don't have a .htaccess file which might change domain.com paths to www.domain.com paths.</p>
  
  <p>Because this test works on our beta server, I have concluded that it's a php configuration issue, but if someone could point me toward the parameter that needs changing, that would be much appreciated!</p>