title: How to restore a PHP session?
body: <p>I understand that PHP stores a user's session id in a cookie called "PHPSESSID" which is stored in the client's browser and is matched against the session on the server to be able to relate the 2. After closing the browser
  the session info dissapears but the cookie on the client remains. Is it possible to use this cookie to restore the old session? Or does all the session data get deleted from the server the moment the client closes their browser?</p>
  
  <p>I had this on my page first:</p>
  
  <pre><code>session_start();
  $_SESSION['message'] = 'Hello';
  
  echo $_SESSION['message']; // outputs hello
  </code></pre>
  
  <p>then I changed the page to:</p>
  
  <pre><code>$old_session = session_id();
  session_id($old_session);
  session_start();
  
  echo $_SESSION['message'];
  </code></pre>
  
  <p>Then I closed the browser and reopened it to this page and got these errors:</p>
  
  <pre><code>Warning: session_start() [function.session-start]: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in C:\xampp\htdocs\localhost\test.php on line 5
  
  Notice: Undefined index: message in C:\xampp\htdocs\localhost\test.php on line 7
  </code></pre>
  
  <p>How exactly does one retrieve old session info after closing the browser, is it even possible?</p>