PHP session doesn't work with IE

前端 未结 12 1094
后悔当初
后悔当初 2020-12-09 05:10

I have a site made with php which uses server side sessions throughout the site.
In fact, it\'s a site with a user login which depends on session variables and if there

相关标签:
12条回答
  • 2020-12-09 05:53

    IE has cookie issues with it's handling of iFrames which maybe causing the session issue you mention, take a look at these links

    http://adamyoung.net/IE-Blocking-iFrame-Cookies

    http://gathadams.com/2007/06/25/how-to-set-third-party-cookies-with-iframe-facebook-applications/

    http://nileshtrivedi.in/blog/2008/09/01/iframe-cookies-and-internet-explorer/

    0 讨论(0)
  • 2020-12-09 05:57

    I had this problem, and it was due to the date on my dev box being out. Firefox didn't mind, IE and chrome were seeing the session as being expired as soon as it was set.

    0 讨论(0)
  • 2020-12-09 06:02

    Maybe it's session.cookie_lifetime. I have faced the same problem. I updated session.cookie_lifetime: 4500 to session.cookie_lifetime:0. This means the session cookie never expires until the browser shuts down.

    0 讨论(0)
  • 2020-12-09 06:05

    Try testing the page while using some sort of monitoring proxy (I use Fiddler) and see what pages the browser requests. That might give you some clues to what's going on.

    Also, try capturing the requests/responses from different browsers and see what IE is doing differently (order of requests, content of requests?).

    To pinpoint the problem, can you rewrite the code without using SESSION (it's mentioned in one of the other answers)? Maybe IE is accessing the pages in different order than other browsers? Maybe it is requesting the main page more than once, which means that the session var is set to "main"? Without session variables, the pages won't affect each other's state.

    0 讨论(0)
  • 2020-12-09 06:05

    Session data is stored on the server side, not the client. I would check the other pages, where this value would be set.

    0 讨论(0)
  • 2020-12-09 06:06

    I found if you added header('P3P: CP="CAO PSA OUR"'); to the top of your doc. It seems to have fixed the problem.

    0 讨论(0)
提交回复
热议问题