cherrypy.session在Chrome上不起作用,但在Firefox上起作用 [英] cherrypy.session won't work on Chrome but works on Firefox
问题描述
我使用CherryPy(版本3.2.0)运行网站,并使用 cherrypy.session
来存储特定于会话的数据.它与Firefox完美配合.但是,我注意到cherrypy.session将在Chrome上运行时出现问题.基本上,当浏览后续页面时,看起来会话变量会重置.
I run a web with CherryPy (version 3.2.0) and use cherrypy.session
to store session specific data. It works perfectly with Firefox. However, I noticed that cherrypy.session would run in problems on Chrome. Basically, it looks like session variable resets when the consequent pages are being browsed.
我相信我的配置设置正确
I believe my config is set correctly
tools.sessions.on = True
tools.sessions.storage_type = "ram"
tools.sessions.storage_path = "/home/dmitry/test/sessions"
tools.sessions.timeout = 60
tools.sessions.name = "test"
什么会导致这种特定于浏览器的问题?
What can lead to such a browser-specific problem?
推荐答案
我猜到现在您已经找到了解决方案,但是一个可能的原因可能是开发服务器在本地主机上运行,而chrome拒绝设置cookie.您必须设置例外才能使其正常运行.在Google上搜索此问题会带来一些有希望的结果.
I guess by now you've figured out the solution, but one possible cause can be that the development server is running on localhost, and chrome refuses to set cookies. You have to set up exceptions to make it work. Searching Google for this issue brings up some promising results.
这篇关于cherrypy.session在Chrome上不起作用,但在Firefox上起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!