Fix bugs in session.py found by pyflakes

darcs-hash:20090225103251-58103-4548051e8f509d0659a711fd3a4e90815ac73e54
Fixed bugs in session.py found by pychecker

darcs-hash:20090225112203-58103-d4c29b741215036994c65bb2ad190c24c337a492