, , , - . , , $this->referer() .
, , . + , $this->referer(), . 1. , 2. . B/c login .
, , , . , $this->referer() , , .
, ( )
$currentLoginUrl = strtolower( "/" .$this->name ."/" .$this->action );
if( $this->referer() != $currentLoginUrl )
{
$this->Session->write('beforeLogin_referer', $this->referer($this->Auth->redirect(), true)) ) ;
}
, ( if( $this->Auth->user() ){ }):
$currentLoginUrl = strtolower( "/" .$this->name ."/" .$this->action );
if( $this->referer() != $currentLoginUrl )
{
$this->redirect($this->referer($this->Auth->redirect(), true));
}
else
{
$this->redirect( $this->Session->read('beforeLogin_referer') );
}
, .