Sessions in TurboGears are easy enough: the documents are very clear.
This ran pretty much first time. During development, using cherrypy's internal server the sessions were all lost whenever I rebooted the server, which was frustrating as it meant I had to log into my web app every time.
When I moved the app to the production server (mod_python) my sessions appeared to die after about 30 seconds. I think this is because apache reboots or something to kill any zombie/trojan activities.
I studied the cherrypy docs which are typically vague and incomplete. In combination with looking in the cherrypy source code, it seems that cherrypy defaults to storing the sessions in ram so they are deleted whenever the process dies. The fix boils down to putting the following in the config file:
sessionFilter.on = True sessionFilter.storageType='File' sessionFilter.storagePath='/var/www/wherever/sessions'
This stores the sessions in files on the server. This may well work on windows too, I haven't tried it yet.
From the source it seems cherrypy only supports sessions in a postgresql database, not mysql
Still, it is possible that files are ultimately more efficient for something simple like this.
I must say I like the way TurboGears has two setup files, one for development and one for production. This makes it very easy for me to develop under windows and deploy on linux. I can use sqlite on windows and mysql on linux. I have needed to create separate startup files as well (on windows to use cherrypy with a debugger, on linux to get it working with mod_python) but once this is done the code is pretty much identical (apart from using samba.winbind under linux to validate users).
Twitterings

File based sessions work on windows very nicely: no need to keep logging in
Peter