title: Session variable for login not passing to redirected page on first attempt
body: <p>hi I have a login system for my admin section that i have a problem with, the problem is that the first time the user attempts to login, the $_SESSION isn't passed to the target page,
  on the second attempt it works fine, this is what is called on the login page</p>
  
  <pre><code>$membership = new Membership();
  if($_POST &amp;&amp; !empty($_POST['username']) &amp;&amp; !empty($_POST['pwd'])) {
  $response = $membership-&gt;validate_User($_POST['username'], $_POST['pwd']);
  </code></pre>
  
  <p>} </p>
  
  <p>in the class memebership</p>
  
  <pre><code>function validate_user($un, $pwd) {
  
      $ensure_credentials =  $this-&gt;verify_Username_and_Pass($un, $pwd);
  
      if($ensure_credentials) {
          $_SESSION['status'] = 'authorized';
          $_SESSION['id'] = $ensure_credentials;
  
          header("location: ambassadorUpdate.php");
          die;
      } else return "Please enter a correct username and password";
  
  }   
  </code></pre>
  
  <p>i've checked the code when i don't then send to ambassadorUpdate and the SESSION is set however if i use the header to redirect to page then the first time the SESSION is not 
  there is a session_start on both pages,</p>
  
  <p>the code runs fine when all the pages where in the same folder, however i am getting this problem when i have organised them in a separate admin folder however all of the files are included correctly,</p>
  
  <p>any ideas greatly appreciated many thanks   </p>