Jason
unread,Oct 15, 2008, 3:52:41 AM10/15/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cherrypy-users
I have two separate web apps running on the same server, residing in
different directories and intended to run on different ports (8080 and
8040). Under CP 3.0, I just had all the site initialisation and config
in separate files ('server.py') for each app, containing the global
config and engine and server startup. Both apps require users to
login, and keep sessions for the users' login.
Basically, the 'server.py' files both contain (I've omitted various
details, and the port value changes):
if __name__ == '__main__' :
global_conf = {
'global' : {
'server.socket_port' : 8040,
'server.socket_host' : ip_address,
'server.thread_pool' : 10,
'server.environment' : "production",
'log.screen' : True,
'log.error_file' : "site.log",
'engine.autoreload_on' : False,
'engine.autoreload_frequency' : 10,
'tools.sessions.on' : True,
'tools.sessions.timeout' : 1440
}
}
app1_conf = {
'/' : {
'tools.staticdir.root' : this_directory},
'/favicon.ico' : {
'tools.staticfile.on' : True,
'tools.staticfile.filename' : os.path.join(this_directory,
"img/
favicon.ico")},
'/css' : {
'tools.staticdir.on' : True,
'tools.staticdir.dir' : "css"},
'/img' : {
'tools.staticdir.on' : True,
'tools.staticdir.dir' : "img"}}
cherrypy.config.update(global_conf)
cherrypy.tree.mount(HomePage(this_directory), '/', app1_conf)
#### 3.0
#cherrypy.server.quickstart()
#cherrypy.engine.start()
####
#### 3.1
cherrypy.engine.start()
cherrypy.engine.block()
####
When I upgraded to 3.1 (and after changing those lines pertaining to
engine and server startup), suddenly the app sessions interfered with
each other. After logging in to one app, reloading a page from the
other app in the same browser cause the user to be logged out of the
first (even if they weren't logged in to the second). It all works
fine if I use different browsers.
I realise that there was some server/engine separation changes from
3.0 to 3.1, but I can't find any detailed documentation on how this
affects sessions. (In fact, I can't really find any on the sessions
tool at all.)
I would appreciate any pointers on how to adapt this setup for the 3.1
changes.
Cheers,
Jason