'Override get_user_cookie to check Referer header'

def get_current_user_cookie(self):

    cookie_user = super().get_current_user_cookie()
    if (cookie_user and (not self.check_referer())):
        return None
    return cookie_user
