@classmethod
def IsConnected(cls, request):
    """The connection status is determined by the session cookie."""
    connection_cookie = request.cookie(cls.COOKIE_CONNECTION)
    if connection_cookie and len(connection_cookie) > 64:
        connection_cookie = connection_cookie[:64]
        return connection_cookie == cls.CreateSessionCookie(request)[:64]
    else:
        return False
