Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

flask set cookie

@app.route('/')
def index():
    resp = make_response(render_template(...))
    resp.set_cookie('somecookiename', 'I am cookie')
    return resp 

@app.route('/get-cookie/')
def get_cookie():
    username = request.cookies.get('somecookiename')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #flask #set #cookie
ADD COMMENT
Topic
Name
1+9 =