会话数据仅在 Chrome 中丢失 [英] Session data lost in Chrome only

查看:25
本文介绍了会话数据仅在 Chrome 中丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个与此线程中的问题类似的问题:仅在 Google Chrome & 中随机丢失会话变量URL重写

I have a problem similar if not identical to the problem in this thread: Randomly Losing Session Variables Only In Google Chrome & URL Rewriting

但是该线程中的所有解决方案都不适用于我.我的 PHP/MySQL 应用程序中只有 Google Chrome 出现了奇怪的行为.如果我用 Firefox 尝试它,它可以工作,但 Chrome 不行.

But all solutions in that thread don't work for me. I'm getting a strange behavior from only Google Chrome in my PHP/MySQL App. If I try it with Firefox, it works, but Chrome doesn't.

我导航到购物车中的某个位置,并在代码中的多个位置存储会话数据.不要担心我会开始会议或任何与此相关的事情,我在 webapp 开发方面有 11 年的经验,一切都很好.

I navigate to some place in my shopping cart and at several places in the code I'll store session data. Don't worry about me starting the session or anything related to that, I've got 11 years in webapp dev, all is done fine.

在所有浏览器中,我可以var_dump($_SESSION) 并取回我的数据,但在 Chrome 中它不保留数据.另请注意,会话确实被传递了,我可以查看网络监视器,我看到正在发送的 cookie 以及许多其他与会话工作相关的事情,但是一个 $_SESSION['last_viewed_element'] 是没有保留.我似乎也无法设置任何其他东西,一切都会丢失.

In all browsers, I can var_dump($_SESSION) and get my data back, but in Chrome it doesn't keep the data. Also note that the session does get passed on, I can look in the network monitor and I see the cookie being sent and many other things related to session work but that one $_SESSION['last_viewed_element'] is not kept. I also can't seem to set anything else, all gets lost.

通过从会话切换到 COOKIES 解决了问题...

Problem resolved by switching from SESSIONS TO COOKIES...

推荐答案

毕竟,没有答案,问题仍然存在,我只是改用 cookie,如果有人同时遇到 chrome+wordpress 的问题时间,不要浪费更多的时间,切换到cookies...

After all, no answer, problem still exists, i just made a switch to using cookies instead, if anyone ever gets that problem with chrome+wordpress at the same time, dont lose more time, switch to cookies...

这篇关于会话数据仅在 Chrome 中丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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