private function checkSessionId(string $id) : bool
    {
        if (preg_match('/^[A-Za-z0-9]+$/', $id) !== 1) {
            return false;
        }

        if (strlen($id) !== $this->idLength) {
            return false;
        }

        return true;
    }
private function checkSessionId(string $id) : bool
    {
        if (preg_match('/^[A-Za-z0-9]+$/', $id) !== 1) {
            return false;
        }

        if (strlen($id) !== $this->idLength) {
            return false;
        }

        return true;
    }
private function checkSessionId ( string $ id ) : bool { if ( preg_match ( '/^[A-Za-z0-9]+$/' , $ id ) !== 1 ) { return false ; } if ( strlen ( $ id ) !== $ this -> idLength ) { return false ; } return true ; }
Checks the validity of a session ID sent in a cookie.

This is a security measure to avoid forged session cookies,
that could be used for example to hack session adapters.

@param string $id

@return bool
Checks the validity of a session ID sent in a cookie .