private function getSession() { $session = $this->getCurrentRequest()->getSession(); if (!$session) { throw new \LogicException('In order to use "state", you must have a session. Set the OAuth2Client to stateless to avoid state'); } return $session; }