mozilla firefox 存储 Cookie 的速度不够快?
所以我使用 PHP 进行了一些会话检查,看看它是否没有被盗。我将请求计数设置为会话数组中的值,并向客户端发送具有相同值的 cookie。如果值不匹配,则表明有人干预。
问题是有时这些值不匹配,我怀疑有人窃取了会话并使用了它。 Firefox 存储 cookie 的速度是否可能很慢? 我问这个问题是因为我的鼠标坏了,当我点击时会发出垃圾邮件。当我使用触摸板时,我永远不会与应用程序断开连接。
So I have some session checking to see if it's not stolen using PHP. I set a request count as a value in the session array and send a cookie with same value to the client. If the values don't match then someone has interfered.
The problem is that sometimes the values don't match and I doubt someone stole the session and used it. Is it possible that Firefox is slow in storing the cookies?
I'm asking this because I have a broken mouse which click-spams when I click. When I use the touchpad I never disconnect from the app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
浏览器通常有多个同时连接到同一网站并并行下载资源。尝试对请求进行计数肯定会产生竞争条件。
如果您想减少会话劫持的机会,请使用 SSL 进行数据传输。
Browsers usually have multiple, simultaneous connections open to the same website and download resources in parallel. Trying to count requests is certain to create race conditions.
If you want to reduce the chances of session hijacking, use SSL for your data transfer.
这可能是由于点击垃圾邮件造成的。 cookie 将在响应中发送,但如果您在浏览器完全加载页面之前中断响应,则浏览器可能不会处理和存储 cookie。当然,会话将会被更新,因为它是在请求发送之前(在 php 关闭时)在服务器上更新的。
这可能会导致以下情况:
您可能应该找到一个更可靠的检测会话劫持的方法,即 SSL。
It's probably due to the click-spamming. The cookie will be sent in the response, but if you interrupt the response before the browser fully loads the page, it will probably not process and store the cookie. Of course the session will have been updated because it is updated on the server before the request is sent (on php shutdown).
This would probably cause a condition where
You should probably find a more reliable method for detecting session hijacking, i.e. SSL.