Strange cakePHP Auth issue for IE (login not working)

I have a strange problem.

I am using CakePHP 1.3.6, and for IE 6-7-8 it does not allow me to log in. I use the correct credentials. tested them with a journal entry.

There is no authentication error. (If I use the wrong credentials then it shows an auth error, but for the correct credentials it shows nothing :()

I tested the whole possibility with the auth component, logging the logs in the error.log file.

I checked the Auth-> user method. It fills the Auth session, but even if it does not redirect me to the right place. I also checked authLoginurl: it is also correct in logs.

I checked the following options,

1) Changed some settings from Core.php

- Session.checkAgent is set to false - Security Level. - Session.start is set to false

2) the disableCache () function is used to log in to avoid caching login data in the browser.

3) After logging out, I destroyed the session.

Here is the code

Application Controller in beforeFilter:

$ this-> Auth-> loginAction = array ('controller' => 'users', 'action' => 'login');

$this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'myaccount'); $this->Auth->userScope = array('User.is_active' => '1', 'User.is_verified' => '1'); //$this->referer(); //auth errors //add it $this->Auth->loginError = "Invalid username or password"; $this->Auth->authError = "Sorry, you must be logged in to visit these pages"; //logout $this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login'); 

User controller beforeFilter ():

function beforeFilter () {

  parent::beforeFilter(); $this->Auth->allow(allowed_actions); 

}

Thnaks, Vijay

+4
source share
1 answer

I had the same problem, it was with a different version of the cake, but maybe this solution will help.

In config, I created my_session.php with the following values:

 ini_restore('session.referer_check'); ini_set('session.use_trans_sid', 0); ini_set('session.name', Configure::read('Session.cookie')); ini_set('session.cookie_lifetime', 0); // Cookie path is now '/' even if you app is within a sub // directory on the domain $this->path = '/'; ini_set('session.cookie_path', $this->path); ini_set('session.cookie_domain', env('HTTP_BASE')); 

The important part is the value of $this->path , now sessions are available for the entire domain.

In core.php for sessions, add:

 Configure::write('Session.save', 'my_session'); 

Hope this helps!

+4
source

All Articles