Adding some cleanup options to the session management code.