How a session is set up