开发者

PHP Webapp With Login Issues Using IE9

开发者 https://www.devze.com 2023-04-03 03:49 出处:网络
I\'ve built a PHP web application. I am getting the following feedback from some users, \"I can successfully login to your website but as soon as I click a link, once logged in, I get kicked out and a

I've built a PHP web application. I am getting the following feedback from some users, "I can successfully login to your website but as soon as I click a link, once logged in, I get kicked out and asked to login again... over and over again".

I am purposefully posting without too many spec开发者_如何学Cifics in an effort to avoid misdirecting any advice you can give me to solve this problem. I'm the sole back-end developer on this project and am looking to this forum for help to identify new things to test because I've been unable to make any progress regarding this problem.

Additional information:

  1. Browser seems to be IE9
  2. I'm using PHP5.3's built in session functions
  3. Sometimes I can reproduce the bug and sometimes I can't - That makes me think it's time oriented (but cannot say for sure).
  4. I think this could be related to cookies.


You'll need to provide more detail, like show an example of the links.

However, one thing that comes to mind immediately is a switch between domain.com and www.domain.com, or a switch between protocols. Those will render the old session cookie invalid, and force a re-login if your system is set up that way.

The best solution for this is usually forcing all requests to go either to domain.com or www.domain.com, whichever you like better.


This is a very common problem in IE7 and it is related to cookies' expiry time. Basically, IE deletes the cookie prior to it's expiration. Try this, before session_start():

session_set_cookie_params(0);

It would force a "permanent" cookie do be created, which would be invalidated whenever the user closes their browser.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号