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

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

问题描述

我有一个类似的问题,如果不是与此线程中的问题相同:
随机丢失会话变量只能在Google Chrome浏览器中使用& URL重写



但该线程中的所有解决方案都不适合我。我在PHP / MySQL应用程序中只使用谷歌浏览器发现了一个奇怪的行为。如果我用Firefox试用它,它可以正常工作,但Chrome不会。



我导航到购物车中的某个位置,并在代码中的几个位置存储会话数据。不要担心我开始会话或与此有关的任何事情,我已经在webapp dev中工作了11年,一切都很好。



在所有浏览器中,我可以 var_dump($ _ SESSION)并获取我的数据,但在Chrome中不保留数据。还要注意会话确实传递了,我可以查看网络监视器,并看到cookie正在发送,还有许多其他事情与会话工作相关,但是 $ _ SESSION ['last_viewed_element'] 不保留。我也似乎无法设置其他任何东西,都会迷路。



编辑:



问题已解决从SESSIONS切换到COOKIES ...

解决方案

毕竟,没有答案,问题依然存在,我只是转而使用cookies,而如果有人在同一时间使用chrome + wordpress来解决这个问题,不要再浪费更多时间,切换到cookie ...

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

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.

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.

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.

EDIT:

Problem resolved by switching from SESSIONS TO 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天全站免登陆