Implementation of sessions.