saving session object in database
version 0.2 with session and other changes