Added some tests and added implementation for the session and its timeout.