redirect in loadhook in web.py
I think redirection is in dead loop.  Maybe your certain var doesn't be saved in session after calling web.seeother
I'm making a web.py app. I'm using a unloadhook function to check if a certain var is in the session for each call.
I need to redirect (to index) if it's not there. However, firefox gives me the message that the redirect will never terminate when I call web.seeother in the unloadhook function. I can correctly detect both cases in the unloadhook and treat the case with the var in the session, but not the second.

def xCheck():
    if 'x' in session:
        print >> sys.stderr, "x in"
        print >> sys.stderr, str(dict(session))
        return
    else:
        print >> sys.stderr, "x out"
        return web.seeother('/')
app.add_processor(web.unloadhook(sessionCheck))