Thanks for the hint! It was the logging indeed. Apparently the logging.conf that comes with web2py was hiding the error: ERROR 2011-07-26 18:44:54,452 restricted.py:156] Traceback (most recent call last): File "/home/momat/workspace/pm-cmp-python/web2py/gluon/main.py", line 531, in wsgibase del response.cookies[response.session_id_name] KeyError: 'session_id_init'
I find out this was cause by the session.forget() in my db.py. It looks like this way of disabling the session is no longer supported (I guess it is disabled by default now).