问题
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