diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index 18880aa6a04..94cbd563482 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -314,7 +314,7 @@ public function startup($controller) { if (!$this->_getUser()) { if (!$request->is('ajax')) { $this->flash($this->authError); - $this->Session->write('Auth.redirect', Router::reverse($request)); + $this->Session->write('Auth.redirect', $request->here()); $controller->redirect($loginAction); return false; } elseif (!empty($this->ajaxLogin)) {