I would like to get a cookie (e.g. country) with this Flask call.
country
data = request.cookies.get("country")
How can I tell if the cookie exists?
request.cookies is a dict, so:
request.cookies
dict
from flask import request if 'country' in request.cookies: # do something else: # do something else
2.1m questions
2.1m answers
60 comments
57.0k users