title: Naming a $_SESSION var from $_SERVER['REQUEST_URI'] keeps mysteriously naming the page "blank.gif"
body: <p>Seems like such a simple problem but I'm out of options here...</p>
  
  <p>So I want to set up a session variable that tells me the last page visited. I thought I could do this by declaring 2 session variables in a php include at the top of every page.</p>
  
  <pre><code>    session_start();    
      if(!$_SESSION['this_url']){
             // will only be declared once
             $_SESSION['this_url'] = $_SERVER['REQUEST_URI'];
          }
  
          if($_SERVER['REQUEST_URI'] != $_SESSION['this_url']){ //dont update var on page refresh
             $_SESSION['last_url'] = $_SESSION['this_url']; 
             $_SESSION['this_url'] = $_SERVER['REQUEST_URI'];  
          }
  </code></pre>
  
  <p>Simple enough right? But for an output it gives me this:</p>
  
  <p><strong>$_SESSION['this_url'] = /support/interactive.php</strong> (correct)</p>
  
  <p><strong>$_SESSION['last_url'] = /products/compatibility/blank.gif</strong> (right path, but blank.gif? wtf?)</p>
  
  <p>it SHOULD be outputting "/products/compatibility/somepage.php" but it always replaces the page name with blank.gif.</p>
  
  <p>I did a sitewide search on my site and nothing else is using my variable names. I even changed the var names and still same result. blank.gif is found in some jQuery scripts - so I suspect this may be where its coming from. But still... I'm declaring these things as the first piece of script on the page and outputting them immediately after declaring them. Is my Apache server messed up or what? this doesnt make sense.</p>
  
  <p>Any ideas would be greatly appreciated, thanks!</p>