Work on session management.  About half done.