cherrypy.session won't work on Chrome but works on Firefox

坚强是说给别人听的谎言 提交于 2019-12-11 14:26:47

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/13037429/cherrypy-session-wont-work-on-chrome-but-works-on-firefox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!