unit tests for session management