Elodie
Elodie

Reputation: 152

Session doesn't create after Ajax Request on Internet Explorer

I'm working on a website and begin debugging Internet Explorer recently. The authentication is made through an Ajax POST request to a PHP Zend action that check login/pass against the database and write a cookie if "Remember me" is triggered. JSON is sent back to Ajax with status code. (Good to go, warning, error etc...) And then something like this :

if( result.code == 0 ){ 
   window.location.reload();
   return false;
}

First, IE tried to dowload some file after login submit which contained the JSON response, so I've made few changes in headers in order to bypass that behavior.

But now, IE does nothing. I mean, Ajax's success function receives the good code (0) that say's everything is ok, it reloads the page, but still not logged in.

In our logs, Zend says everything is ok too.

Note : I've noticed that I could log in only when I check "Remember me" checkbox.

Where do you think that come from ? It's running well on other browsers and I'm going nuts.

EDIT 1 : No changes after adding P3P headers.

Upvotes: 0

Views: 1460

Answers (2)

Elodie
Elodie

Reputation: 152

We finally got it. Thanks Christian, this link definetely helped. For security reasons, we were regenerating session ID with Zend_Session::regenerateId() after login check. Where other browsers are only regenerating session ID, IE destroys and generate a new one. So it loose the connection. (I suppose)

Upvotes: 0

Christian Burger
Christian Burger

Reputation: 675

This is a long shot, but is the page perhaps being cached by the browser? In other words, do any of these methods help: window.location.reload with clear cache

Alternatively, the link in this answer highlights some other things to check (including time difference that affect IE but not FF)

Upvotes: 1

Related Questions