determining when a session is created