Sunday, December 28, 2008

Odd Auth behaviour in IE7 (Internet Explorer)

Hi

I am using the Auth component and I did not notice this behaviour yet.
Maybe it came with an Microsoft Update (?).
The problem is in IE7 (and IE6, but there are other problems, there).
In Chrome and FireFox everything works.

Description of the problem:
I am trying to login, sometimes it works on the first attempt,
sometimes not until the xth (x=random) attempt. Sometimes it helps to
click another controller or action, sometimes not. Sometimes a page
refresh helps, sometimes not. I do not see a pattern.
Interesting is, as I am saving the latest login, that the login
actually is successfull, as the db field "last_login" gets updated,
but after the redirect, I am redirected back to the login page
displaying the "$this->Auth->authError" (not the loginError). So I am
getting redirected to the member page, but it somehow does not
recognize that I am logged in and redirects me back out. After
resubmitting the form x times, I can eventually login.


I have tried a lot of things, like:
- $this->Session->destroy() in the logout function

- $this->disableCache() in the beforeFilter in the app_controller


Some code:

// in app_controller.php
function beforeFilter(){
$this->disableCache();

$this->Auth->fields = array('username' => 'email', 'password' =>
'password');
$this->Auth->loginAction = '/users/login';
$this->Auth->loginRedirect = array('controller' => 'publications',
'action' => 'index');
$this->Auth->logoutRedirect = '/users/login';
$this->Auth->loginError = 'Invalid username / password combination.
Please try again';
$this->Auth->autoRedirect = false;
$this->Auth->authError = "Please log in first in order to perform
this action.";

$this->Auth->allow('view', 'signup', 'login', 'logout');
$this->Auth->authorize = 'controller';
}
function isAuthorized() {
return true;
}


At "/users/login" the login form is located, and the form action is
also users/login. I also varied this:

$this->redirect(array('controller'=>'publications',
'action'=>'index'));
$this->redirect('/publications/index/');
$this->redirect($this->Auth->redirect());

Each variation gave me the same results: randomly I am logged in,
randomly it shows errors. What could this be?

Thanks, yves.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: