title: sessions not being set in all pages on php5
body: <p>I am using session_start(); at the top of my login page. After a user logs in, a message is displayed on screen which shows that the session is being set. But, I cannot carry sessions from page to page or can I echo out SID. It is a blank value. I would be grateful if someone could show me where I am going wrong. Thanks</p>
  
  <pre><code>&lt;?php
  
    $userpost = mysql_real_escape_string($_POST['user']);
  
    if (!isset($_SESSION['user'])) {
     session_start();
     $_SESSION['user'] = $userpost;
  }
  
     echo $_SESSION['user'] .' '. 'Just logged in' .  SID;
     // Or maybe pass along the session id, if needed
  
  ?&gt;
  </code></pre>