title: php - session, check for admin
body: <p>I have everything working on my login except for the admin user.</p>
  
  <p>When I try to navigate to my admin.php I get "Must be logged in" even if I am already logged in as an admin.</p>
  
  <p>When I click the admin link, I first go to checkAdmin.php which is the code below.</p>
  
  <pre><code>&lt;?php
  if($_SESSION['userEmail'] != 'admin@hotmail.com') {
      echo "&lt;center&gt;&lt;font face='Verdana' size='2' color=red&gt;Must be logged in&lt;/font&gt; &lt;br&gt;&lt;a href=index.php&gt;Login Here&lt;/a&gt;&lt;/center&gt;";
      exit;
  }
  ?&gt;
  </code></pre>
  
  <p>Am I doing something wrong on this?
  Thanks.</p>
  
  <p>I have session_start(); at the top of my admin.php page.
  I used print_r($_SESSION); and got this line, so it has the right value.</p>
  
  <pre><code>Array ( [userEmail] =&gt; admin@hotmail.com ) 
  </code></pre>
  
  <p>Also, if I add session_start(); to the checkAdmin.php then the screen just sits at checkAdmin, when I click to go to the admin page.</p>
  
  <p>The admin.php has this at the top</p>
  
  <pre><code>session_start();
  require "checkAdmin.php";
  include("db_info.php");
  </code></pre>