title: PHP Sessions issues while on server but no on localhost
body: <p>I'm passing the user variable through sessions. It works fine on the localhost but once on the web server it does weird things. </p>
  
  <p>After logging in, the session variable works as should.....until you click on about three pages and it suddenly goes POOF!</p>
  
  <p>Notice the "<code>Welcome, jordan.</code>" as opposed to the "<code>Welcome, .</code>" Also the top left corner.</p>
  
  <p>Session functioning: 
  <a href="http://imageshack.us/photo/my-images/32/loggedins.png/" rel="nofollow">http://imageshack.us/photo/my-images/32/loggedins.png/</a></p>
  
  <p>Session POOF!
  <a href="http://imageshack.us/photo/my-images/515/loggedinno.png/" rel="nofollow">http://imageshack.us/photo/my-images/515/loggedinno.png/</a></p>
  
  <p>Login/Create session variable code:</p>
  
  <pre><code>&lt;?php
          if (!isset($_SESSION['user']))
          {
          if (isset($_POST['user']))
          {
          $user = sanitizeString($_POST['user']);
          $pass = sanitizeString($_POST['pass']);
          if (preg_match($txtMatch,$user))
          {
          if ($user == "" || $pass == "")
          {
          $error = "Please enter all required fields";
          }
          else
          {
          $query = "SELECT * FROM gtmembers WHERE user='$user'";
          $result = queryMysql($query);
          $rank = mysql_result($result, 0, 'rank');
          if (!mysql_num_rows($result))
          {
          $error = "Username does not exist.";
          }
          else
          {
          $getPass = mysql_result($result, 0, 'pass');
          $salt = substr($getPass, 0, 64);
          $hash = $salt . $pass;
          for ($i = 0; $i &lt; 100000; $i++) 
          {
          $hash = hash('sha256', $hash);
          }
          $hash = $salt . $hash;
          if ($hash == $getPass)
          {
          if ($rank != "Banned")
          {
          $userLow = strtolower($user);
          $_SESSION['user'] = $userLow;
          $_SESSION['rank'] = $rank;
          echo &lt;&lt;&lt;_END
          &lt;script type="text/javascript"&gt;
          window.location.href='index.php';
          &lt;/script&gt;
          _END;
          echo "Successfully logged in. Click &lt;a href='index.php'&gt;here&lt;/a&gt; to continue.";
          }
  </code></pre>
  
  <p>Header Code:</p>
  
  <pre><code>        &lt;?php //gtheader.php
          session_start();
          include_once 'gtfunctions.php';
          $loggedIn = FALSE;
  
          if (isset($_SESSION['user']))
          {
          $user = $_SESSION['user'];
          if ($user) echo "Current User: $user&lt;br /&gt;";
          else echo "Current User: None&lt;br /&gt;";
          $rank = $_SESSION['rank'];
          $loggedIn = TRUE;
          echo "is set SESSION['user']? Yes";
          }
          else echo "is set SESSION['user']? No";
  
          echo "&lt;div id='header'&gt;&lt;a class='header' href='index.php'&gt; &lt;h1 id='headerTitle'&gt;$appname&lt;/h1&gt;&lt;/a&gt;";
          if ($loggedIn == TRUE)
          {
          $query = "SELECT * FROM gtmessages WHERE recip='$user' AND status='0'";
          $result = queryMysql($query);
          if (mysql_num_rows($result) == 0) $num = "";
          else $num = "[".mysql_num_rows($result)."]";
          if ($rank == 'Owner' || $rank == 'Admin')
          {
          echo "Welcome, &lt;a class='header' href='gtmembers.php?view=$user'&gt;$user&lt;/a&gt;&lt;a     class='header' href='gtmessage.php'&gt;$num&lt;/a&gt;. [&lt;a class='header'     href='gtlogout.php'&gt;Logout&lt;/a&gt;] | &lt;a class='header' href='gtadmin.php'&gt;Admin&lt;/a&gt;&lt;br /&gt;";
          }
          else
          {
          echo "Welcome, &lt;a class='header' href='gtmembers.php?view=$user'&gt;$user&lt;/a&gt;&lt;a     class='header' href='gtmessage.php'&gt;$num&lt;/a&gt;. [&lt;a class='header'     href='gtlogout.php'&gt;Logout&lt;/a&gt;]&lt;br /&gt;";
          }
          }
  ?&gt;
  </code></pre>