title: CakePHP Auth.redirect not being written
body: <p>I have followed the authentication tutorial in the cakephp documentation and created a working login system.</p>
  
  <p>One thing I'm trying to do is have the user redirected to the action they were trying to access initially when not logged in, after they complete login.</p>
  
  <p>I believe the page they were visiting is supposed to be written to Auth.redirect within the session by the startup function in the Auth component, however this doesn't appear to be working.</p>
  
  <p>In my users controller I have added the following to the beforefilter: </p>
  
  <pre><code>$this-&gt;Auth-&gt;allow('add', 'login');
  </code></pre>
  
  <p>Therefore when trying to access the edit action I'm redirected automatically to the login action.</p>
  
  <p>In the login action, I've included:</p>
  
  <pre><code>debug($this-&gt;Session-&gt;read());
  debug($this-&gt;referer());
  </code></pre>
  
  <p>This is outputting the session information, and in this session there is no mention of Auth.redirect so neither the Auth function or myself is unable to use this to redirect the user with.</p>
  
  <p>I've tried using $this->referer but for some reason when being redirected automatically by the auth function the referer isn't being tracked either.</p>
  
  <p>Does anyone know a reason why auth.redirect might not be being written and why $this->referer isn't being populated when redirected by the auth function?</p>
  
  <p>I must note I am on a windows machine using WAMP. However my add action redirects to login after success and debug($this->referer()); picks up the redirect URL when this occurs so the headers must be working fine.</p>
  
  <p><strong>Further Notes:</strong></p>
  
  <p>I've identified the issue with CakePHP by looking through the sessions stored in the database.</p>
  
  <p>It seems that the auth.redirect is stored in the session, however for some reason a new session is generated when the user is redirected clearing the previous data.</p>
  
  <p>Is there anyway to stop CakePHP creating new session ids for users?</p>