I am trying to implement a login system that will be smart enough to redirect the user to the page they were on before they (or were forced to) go to the login page.
I know this seems like a similar question to this , and this one , but they do not address both of my scripts.
There are two scenarios here:
The user specifically decides to go to the login page:
<a href="<?php echo $this->url(array(
'controller'=>'auth',
'action'=>'login'), 'default', true); ?>">Log In</a>
The user is redirected as he tries to access protected content:
if (!Zend_Auth::getInstance()->hasIdentity()) {
$this->_helper->redirector('login', 'auth');
}
How can I implement a solution for this without displaying a "redirect to" URL in the address bar?