PHP会话Cookie失败,用户更改IP [英] PHP Session Cookies fail with users changing IP

查看:233
本文介绍了PHP会话Cookie失败,用户更改IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小型应用程序的登录脚本,它通过存储会话Cookie并在每个页面上检查它们以确保用户已登录。
使用系统的两个用户之一会继续登出随机。
这似乎是显示的会话cookie,然后显示验证不再存在。



经过很多调查后,我可以看到的唯一的东西是不同的是这个用户的是他们的IP地址正在改变(今天它是每小时更改(他们在天空))。
唯一的事情是IP地址的更改已经发生了5次上午,只有一次用户已经注销。



有任何人有类似的问题?



会话cookie是否与IP地址绑定?



任何帮助或链接非常感谢。 p>

感谢



C

解决方案<


没有。只要浏览器连接到相同的IP名称服务器端,无论客户端是否处理更改或通过不同的代理。



正在缓存在它不应该。 (假设您不对IP地址进行验证)。



您的Web服务器是否已配置为针对请求/客户端/用户代理记录会话ID? (即在访问日志中)



C。


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 who uses the system keeps getting logged out randomly. This appears to be down to the session cookie that shows then authenticated no longer being present.

After a lot of investigation the only thing I can see that is different about this user is that their IP address is changing (today it was changing every hour (their on Sky)). The only thing is the change of IP address has happened 5 times this morning and only once has the user been logged off.

Has anyone had a similar issue?

Are session cookies in someway tied to IP addresses?

Any help or links much appreciated.

Thanks

C

解决方案

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.

这篇关于PHP会话Cookie失败,用户更改IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆