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
1.4m articles
1.4m replys
5 comments
57.0k users