added the accessor "session" for the cookie, cleaned the code and added documentation