public function setId($id) { if ($this->sessionExists()) { throw new SessionException('Session has already been started, to change the session ID call regenerateId()'); } session_id($id); return $this; }