子域overwitting codeigniter会话 [英] Subdomain overwiting codeigniter session
问题描述
我有2个codeigniter安装,1在mydomain.com另一个在sub.mydomain.com
我想让sub.mydomain.com能够访问由mydomain.com创建的CI会话。我已将两个配置文件的cookie部分编辑到
$ config ['cookie_prefix'] =
$ config ['cookie_domain'] =.mydomain.com;
$ config ['cookie_path'] =/;
$ config ['cookie_secure'] = FALSE;
现在如果我去mydomain.com设置会话然后去sub.mydomain.com似乎用一个新的会话覆盖会话,而不是能够从现有会话读取。
我缺少这里的东西吗?
非常感谢!
Martin
这让我疯狂了好几个小时,但解决方案我忘了确保
$ config ['encryption_key']
pre>
对于这两个应用程序是一样的!
现在工作得很好
I have 2 codeigniter installations, 1 on mydomain.com another on sub.mydomain.com
I am trying to get sub.mydomain.com to be able to access the CI session created by mydomain.com. I have edited the cookie section of both config files to
$config['cookie_prefix'] = ""; $config['cookie_domain'] = ".mydomain.com"; $config['cookie_path'] = "/"; $config['cookie_secure'] = FALSE;
Now if I go to mydomain.com setting the session and then go to sub.mydomain.com it seems to overwrite the session with a new one rather than being able to read from the existing session.
Am I missing something here?
Thanks a lot! Martin
解决方案This was driving me crazy for hours but the solution (as usual) was simple. I had forgotten to make sure
$config[‘encryption_key’]
was the same for both applications!
Working great now
这篇关于子域overwitting codeigniter会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!