protected function validSession(): bool
    {
        if (
            !array_key_exists(self::CLIENT_SIGNATURE, $_SESSION)
            || !array_key_exists(self::SESSION_CREATED, $_SESSION)
        ) {
            //Missing session signature or timestamp!
            return false;
        }

        if ($_SESSION[self::SESSION_CREATED] < time() - $this->lifetime) {
            //Session expired
            return false;
        }

        if (!hash_equals($_SESSION[self::CLIENT_SIGNATURE], $this->clientSignature)) {
            //Signatures do not match
            return false;
        }

        return true;
    }
protected function validSession(): bool
    {
        if (
            !array_key_exists(self::CLIENT_SIGNATURE, $_SESSION)
            || !array_key_exists(self::SESSION_CREATED, $_SESSION)
        ) {
            //Missing session signature or timestamp!
            return false;
        }

        if ($_SESSION[self::SESSION_CREATED] < time() - $this->lifetime) {
            //Session expired
            return false;
        }

        if (!hash_equals($_SESSION[self::CLIENT_SIGNATURE], $this->clientSignature)) {
            //Signatures do not match
            return false;
        }

        return true;
    }
protected function validSession ( ) : bool { if ( ! array_key_exists ( self :: CLIENT_SIGNATURE , $ _SESSION ) || ! array_key_exists ( self :: SESSION_CREATED , $ _SESSION ) ) { //Missing session signature or timestamp! return false ; } if ( $ _SESSION [ self :: SESSION_CREATED ] < time ( ) - $ this -> lifetime ) { //Session expired return false ; } if ( ! hash_equals ( $ _SESSION [ self :: CLIENT_SIGNATURE ] , $ this -> clientSignature ) ) { //Signatures do not match return false ; } return true ; }
Check if session is valid for

@return bool
Check if session is valid for