Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Shorten cart cookie expiration time to one month

Anna Siwik83e49f6f0773
diff --git a/saleor/checkout/utils.py b/saleor/checkout/utils.py
index ca4f5f0579..7ba9a62986 100644
--- a/saleor/checkout/utils.py
+++ b/saleor/checkout/utils.py
@@ -34,11 +34,10 @@ COOKIE_NAME = 'cart'
def set_cart_cookie(simple_cart, response):
- """Update respons with a cart token cookie."""
+ """Update response with a cart token cookie."""
# FIXME: document why session is not used
- ten_years = timedelta(days=(365 * 10))
- response.set_signed_cookie(
- COOKIE_NAME, simple_cart.token, max_age=int(ten_years.total_seconds()))
+ max_age = int(timedelta(days=30).total_seconds())
+ response.set_signed_cookie(COOKIE_NAME, simple_cart.token, max_age=max_age)
def contains_unavailable_variants(cart):