title: Notice: Undefined variable: _Session
body: <p>Looked through all the other PHP Session pages that I thought were relevant, and couldn't find what the problem on my page would be. Below is my code for the 3 pages:</p>
  
  <p>Login.htm (This works)</p>
  
  <pre><code>      &lt;body&gt;
    &lt;section class="container"&gt;
      &lt;div class="login"&gt;
        &lt;h1&gt;Login to Web App&lt;/h1&gt;
        &lt;form method="post" action="checklogin.php"&gt;
          &lt;p&gt;&lt;input type="text" name="login" value="" placeholder="Username or Email"&gt;&lt;/p&gt;
          &lt;p&gt;&lt;input type="password" name="password" value="" placeholder="Password"&gt;&lt;/p&gt;
          &lt;p class="remember_me"&gt;
            &lt;label&gt;
              &lt;input type="checkbox" name="remember_me" id="remember_me"&gt;
              Remember me on this computer
            &lt;/label&gt;
          &lt;/p&gt;
          &lt;p class="submit"&gt;&lt;input type="submit" name="commit" value="Login"&gt;&lt;/p&gt;
        &lt;/form&gt;
      &lt;/div&gt;
  
      &lt;div class="login-help"&gt;
        &lt;p&gt;Forgot your password? &lt;a href="index.html"&gt;Click here to reset it&lt;/a&gt;.&lt;/p&gt;
      &lt;/div&gt;
    &lt;/section&gt;
  
    &lt;section class="about"&gt;
      &lt;p class="about-links"&gt;
        &lt;a href="http://www.cssflow.com/snippets/login-form" target="_parent"&gt;View Article&lt;/a&gt;
        &lt;a href="http://www.cssflow.com/snippets/login-form.zip" target="_parent"&gt;Download&lt;/a&gt;
      &lt;/p&gt;
      &lt;p class="about-author"&gt;
        &amp;copy; 2012&amp;ndash;2013 &lt;a href="http://thibaut.me" target="_blank"&gt;Thibaut Courouble&lt;/a&gt; -
        &lt;a href="http://www.cssflow.com/mit-license" target="_blank"&gt;MIT License&lt;/a&gt;&lt;br&gt;
        Original PSD by &lt;a href="http://www.premiumpixels.com/freebies/clean-simple-login-form-psd/" target="_blank"&gt;Orman Clark&lt;/a&gt;
    &lt;/section&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>checklogin.php (this works, session is successfully created, you can see my testing in code to make sure the session is actually set)</p>
  
  <pre><code>&lt;?php
  session_start();
  $con=mysqli_connect("someServer","root","somePassword","someDatabase");
  // Check connection
  if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  //Get the two variables for login and password from the form on login.htm
  $user = $_POST['login'];
  $password = $_POST['password'];
  //Write out your MySql Query
  $result = mysqli_query($con,"SELECT * FROM members where username = '$user' and password = '$password'");
  //Get the row number your query sends out. This is to make sure the username / password combo actually exist
  $num_row = mysqli_num_rows($result);
  
  if ( $num_row == 1 )
  {
  while($row = mysqli_fetch_array($result)) {
  //Get the data from MySQL
    echo $row['username'] . " " . $row['password'];
    //Set whatever is in username to the variable $user1
    $user1 = $row['username'];
    echo "&lt;br&gt;";
    echo $user1;
    echo "&lt;br&gt;";
    //Start Sessions
    //set the session username5 to whatever was in the SQL table for user
    $_Session['username5'] = $user1;
    //Read off the session stored variable
    echo $_Session['username5'];
  
  }
  } else {
  echo 'That shit didnt work';
  }
  
  // rest of page . . 
  if ($_Session['username5']) {
  header( 'Location: https://localhost/avesi/login_success.php' ) ;
  }else{
  echo "Login Failed!";
  }
  
  mysqli_close($con);
  ?&gt;
  </code></pre>
  
  <p>Login_success.php (this is where I get the error - Notice: Undefined variable: _Session in C:\xampp\htdocs\avesi\login_success.php on line 10)</p>
  
  <pre><code>&lt;?php
  session_start();
  echo time();
  if (!empty($_SESSION['username5'])) {
  echo "Not empty";
  }else{
  echo "Empty";
  }
  
  echo $_Session['username5'];
  ?&gt;
  </code></pre>
  
  <p>On checklogin.php, it returns the username in the echo for $_Session['username5'], so I know a session is set.</p>
  
  <p>On Login_success, I get the "empty" from the echo, and the error from the echo $_Session['username5']; like its not set at all anymore.</p>
  
  <p>Both pages reference session_start() so I'm not sure what the problem is. I am pretty new to PHP so any help would be appreciated!</p>