title: PHP's $_SESSION with jQuery load() is empty
body: <p>I am trying to insert a login form with jQuery's <code>load</code> method into a larger webpage (Grails gsp). Users are managed by a PHP backend, which should provide different versions of the login form, depending on the user being logged in or not.</p>
  
  <p>When I call the PHP address directly (browser), the correct form is loaded - but with jQuery's <code>load</code> the <code>$_SESSION</code> is always empty and only the form for logged-out users is displayed.</p>
  
  <p>What part of PHP's <code>$_SESSION</code> am I missing? Or is it a jQuery problem?</p>
  
  <p>Edit, PHP Code:</p>
  
  <pre><code>&lt;?php
  
  session_start();
  
  $template_dir = "http://" . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'],0,strrpos($_SERVER['PHP_SELF'],'/'));
  
  $root_dir = substr($template_dir,0,strrpos($template_dir,'/'));
  
  $show_loginform = isset($_GET['show_loginform']) ? true : false;
  $username = isset($_SESSION['login']['username']) ? $_SESSION['login']['username'] : 'Anonymous'; // always 'Anonymous' when using jQuery load
  ?&gt;
  ...
  </code></pre>
  
  <p>Greetings,
  smon</p>