first implementation of the session