From ae73a85e2047b405d1fe8cf78aa5556673eec0d5 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 19 Aug 2020 16:11:45 +0530 Subject: set cookie in the right place --- talermerchantdemos/blog/blog.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'talermerchantdemos/blog') diff --git a/talermerchantdemos/blog/blog.py b/talermerchantdemos/blog/blog.py index 6c4c3ec..77d8813 100644 --- a/talermerchantdemos/blog/blog.py +++ b/talermerchantdemos/blog/blog.py @@ -218,7 +218,6 @@ def article(article_name, data=None): ) order_resp = backend_post(BACKEND_URL, "private/orders", dict(order=order)) order_id = order_resp["order_id"] - flask.request.set_cookie("order_id", path=f"/essay/{article_name}") # Ask the backend for the status of the payment pay_status = backend_get( @@ -237,7 +236,9 @@ def article(article_name, data=None): ) else: return render_article(article_name, data, order_id) - else: - # Redirect the browser to a page where the wallet can - # run the payment protocol. - return flask.redirect(pay_status["order_status_url"]) + + # Redirect the browser to a page where the wallet can + # run the payment protocol. + response = flask.redirect(pay_status["order_status_url"]) + response.set_cookie("order_id", order_id, path=f"/essay/{article_name}") + return response -- cgit v1.2.3