'Returns the currently active CSRF token by checking the cookies
sent with the current request.'

def get_csrf_token(self, request):

    bound_cookies = self.cookie_profile.bind(request)
    token = bound_cookies.get_value()
    if (not token):
        token = self.new_csrf_token(request)
    return token
