public function getSession()
    {
        if (null === $this->requestStack) {
            throw new \RuntimeException('The "app.session" variable is not available.');
        }

        if ($request = $this->getRequest()) {
            return $request->getSession();
        }
    }
public function getSession()
    {
        if (null === $this->requestStack) {
            throw new \RuntimeException('The "app.session" variable is not available.');
        }

        if ($request = $this->getRequest()) {
            return $request->getSession();
        }
    }
public function getSession ( ) { if ( null === $ this -> requestStack ) { throw new \ RuntimeException ( 'The "app.session" variable is not available.' ) ; } if ( $ request = $ this -> getRequest ( ) ) { return $ request -> getSession ( ) ; } }
Returns the current session.

@return Session|null The session
Returns the current session .