src/Security/SecurityToken.php
protected function getSession()
    {
        $injector = Injector::inst();
        if ($injector->has(HTTPRequest::class)) {
            return $injector->get(HTTPRequest::class)->getSession();
        } elseif (Controller::has_curr()) {
            return Controller::curr()->getRequest()->getSession();
        }
        throw new Exception('No HTTPRequest object or controller available yet!');
    }
protected function getSession()
    {
        $injector = Injector::inst();
        if ($injector->has(HTTPRequest::class)) {
            return $injector->get(HTTPRequest::class)->getSession();
        } elseif (Controller::has_curr()) {
            return Controller::curr()->getRequest()->getSession();
        }
        throw new Exception('No HTTPRequest object or controller available yet!');
    }
protected function getSession ( ) { $ injector = Injector :: inst ( ) ; if ( $ injector -> has ( HTTPRequest :: class ) ) { return $ injector -> get ( HTTPRequest :: class ) -> getSession ( ) ; } elseif ( Controller :: has_curr ( ) ) { return Controller :: curr ( ) -> getRequest ( ) -> getSession ( ) ; } throw new Exception ( 'No HTTPRequest object or controller available yet!' ) ; }
Returns the current session instance from the injector

@return Session
@throws Exception If the HTTPRequest class hasn't been registered as a service and no controllers exist
Returns the current session instance from the injector