PHP Session Cookies fail with users changing IP

后端 未结 2 644
半阙折子戏
半阙折子戏 2020-12-21 04:07

I have a login script for a small application that works by storing session cookies and checking them on each page to make sure the user is logged in. One of the two users w

相关标签:
2条回答
  • 2020-12-21 04:38

    By default the PHP Session does not account for IP changes. It's only based in the cookie value.

    So perhaps maybe there is some customized code in your web app that invalidates the session when a user changes the IP address.

    0 讨论(0)
  • 2020-12-21 04:55

    Are session cookies in someway tied to IP addresses?

    No. As long as the browser is connecting to the same IP name serverside it doesn't matter if the clients address changes or goes via a different proxy.

    It's more likely that something is getting cached where it shouldn't. (assuming you are doing no validation against IP address).

    Have you got your webserver configured to log session ids against the request/client/user agent? (i.e. in the access log)

    C.

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