title: php session variables without cookies
body: <p>I try to access session variables stored on a different page. When I have cookies enabled it works, but the session variables are gone when I disable cookies.</p>
  
  <p>Here's an example:</p>
  
  <pre><code>&lt;?php
  //page1.php
  
  session_start();
  
  $_SESSION['startTime'] = time();
  
  echo("&lt;a href=\"page2.php?" . session_name() . "=" . session_id() . "\"&gt;Page2&lt;/a&gt;&lt;br /&gt;\n");
  
  echo("Session-ID: " . session_id() . "&lt;br /&gt;");
  echo("Session-Content: " . print_r($_SESSION));
  
  // output:
  // &lt;a href="page2.php?PHPSESSID=ou1n4mrotvqc6dod41q8t0a432"&gt;Page2&lt;/a&gt;&lt;br /&gt;
  // Session-ID: ou1n4mrotvqc6dod41q8t0a432&lt;br /&gt;Array
  // (
  //     [startTime] =&gt; 1339177944
  // )
  // Session-Content: 1
  ?&gt;
  
  &lt;?php
  //page2.php
  
  session_start();
  
  session_id($_GET[session_name()]);
  
  echo("Session-ID: " . session_id() . "&lt;br /&gt;\n");
  echo("Session-Content: " . print_r($_SESSION));
  
  session_destroy();
  
  // output
  // Session-ID: ou1n4mrotvqc6dod41q8t0a432&lt;br /&gt;
  // Array
  // (
  // )
  // Session-Content: 1
  ?&gt;
  </code></pre>
  
  <p>Am I doing something wrong? How can I use session variables whith cookies disabled?</p>