public static function getSessionHandler() {
        $sessionDriver = get_config('session_driver');
        
        self::$sessionDriver = $sessionDriver ? $sessionDriver : 'native';

        if (self::$sessionDriver) {
            switch (self::$sessionDriver) {
                case 'native':
                    self::$sessionHandler = new Session(get_config('session_timeout'));
                    break;
                case 'database':
                    self::$sessionHandler = new DbSession(get_config('session_timeout'));
                    break;
            }
        }

        if (self::$sessionHandler) {
            return self::$sessionHandler;
        } else {
            throw new \Exception(ExceptionMessages::MISCONFIGURED_SESSION_HANDLER);
        }
    }
public static function getSessionHandler() {
        $sessionDriver = get_config('session_driver');
        
        self::$sessionDriver = $sessionDriver ? $sessionDriver : 'native';

        if (self::$sessionDriver) {
            switch (self::$sessionDriver) {
                case 'native':
                    self::$sessionHandler = new Session(get_config('session_timeout'));
                    break;
                case 'database':
                    self::$sessionHandler = new DbSession(get_config('session_timeout'));
                    break;
            }
        }

        if (self::$sessionHandler) {
            return self::$sessionHandler;
        } else {
            throw new \Exception(ExceptionMessages::MISCONFIGURED_SESSION_HANDLER);
        }
    }
public static function getSessionHandler ( ) { $ sessionDriver = get_config ( 'session_driver' ) ; self :: $ sessionDriver = $ sessionDriver ? $ sessionDriver : 'native' ; if ( self :: $ sessionDriver ) { switch ( self :: $ sessionDriver ) { case 'native' : self :: $ sessionHandler = new Session ( get_config ( 'session_timeout' ) ) ; break ; case 'database' : self :: $ sessionHandler = new DbSession ( get_config ( 'session_timeout' ) ) ; break ; } } if ( self :: $ sessionHandler ) { return self :: $ sessionHandler ; } else { throw new \ Exception ( ExceptionMessages :: MISCONFIGURED_SESSION_HANDLER ) ; } }
Get session handler

@return object
@throws \Exception When session handler is not correctly configured
Get session handler