From b61972871a61f0f6ed064600d678d57009f4b6be Mon Sep 17 00:00:00 2001 From: David Steinsland Date: Tue, 22 Jul 2014 13:21:42 +0200 Subject: [PATCH] Fixed sending of headers when ajaxLogin is set --- lib/Cake/Controller/Component/AuthComponent.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index b5cdda8bc44..5435862f6c4 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -367,7 +367,8 @@ protected function _unauthenticated(Controller $controller) { if (!empty($this->ajaxLogin)) { $controller->response->statusCode(403); $controller->viewPath = 'Elements'; - echo $controller->render($this->ajaxLogin, $this->RequestHandler->ajaxLayout); + $response = $controller->render($this->ajaxLogin, $this->RequestHandler->ajaxLayout); + $response->send(); $this->_stop(); return false; }