Fixed remember me cookie on login

This commit is contained in:
Karl Cordes 2012-09-08 11:40:45 +10:00
parent 47c9cf2ba5
commit 7b2180821c
2 changed files with 6 additions and 3 deletions

View file

@ -16,7 +16,9 @@ class AppController extends Controller {
$this->Auth->allow('display');
$this->Auth->authorize = 'controller';
if($this->RequestHandler->isAjax()) {
$this->Auth->autoRedirect = false;
if($this->RequestHandler->isAjax()) {
Configure::write('debug', 0);
}

View file

@ -26,7 +26,8 @@ class UsersController extends AppController {
/* Auth Cookie code from http://www.webdevelopment2.com/cakephp-auth-component-tutorial-3/ */
// code inside this function will execute only when autoRedirect was set to false (i.e. in a beforeFilter).
// code inside this function will execute only when autoRedirect
//was set to false (i.e. in a beforeFilter).
if ($this->Auth->user()) {
if (!empty($this->data) && $this->data['User']['remember_me']) {
$cookie = array();