title: Problems with isset() and $_SESSION variables
body: <p>I'm currently working on a project that requires session variables to store search information, which is pretty common place. Typically, I've used isset() to check if a session variable exists. However, there seems to be a problem that is bewildering...not sure what is going on. Any help is appreciated. The code...</p>
  
  <pre><code>&lt;?php
  # Check to make sure the session is started 
  if (session_id() != '') echo 'Session has started&lt;br/&gt;';
  # Check every possible way I know to make sure variable is set
  if (array_key_exists('adminsearchrange', $_SESSION) &amp;&amp; isset($_SESSION['adminsearchrange']) 
      &amp;&amp; !empty($_SESSION['adminsearchrange']) &amp;&amp; $_SESSION['adminsearchrange'] != NULL) {
      echo 'Search range is set and is not empty&lt;br/&gt;';
      echo $_SESSION['adminsearchrange'];
  }
  ?&gt;
  </code></pre>
  
  <p>The output...</p>
  
  <pre><code>Session has started
  Search range is set and is not empty
  Notice: Undefined index: adminsearchrange in /Users/.../events_items.php on line 1182
  </code></pre>
  
  <p>Based on the comments, I took the simplest approach...created a new file whose entire contents is listed below. Still get the same error (above), and oddly enough, it still references the the exact line and file (even though that file is not being included in any way)...and no, there isn't any <code>.htaccess</code> rewriting of any sort. The code (all in one file)...</p>
  
  <pre><code>&lt;?php
  session_start();
  if (session_id() != '') echo 'Session has started&lt;br/&gt;';
  if (array_key_exists('adminsearchrange', $_SESSION) &amp;&amp; isset($_SESSION['adminsearchrange']) 
      &amp;&amp; !empty($_SESSION['adminsearchrange']) &amp;&amp; $_SESSION['adminsearchrange'] != NULL) {
      echo 'Search range is set and is not empty&lt;br/&gt;';
      echo $_SESSION['adminsearchrange'];
  }
  ?&gt;
  </code></pre>