Snippets are unofficial and unmaintained.
This is an archived view of user-submitted snippets. Despite being hosted on the Flask site, they are not official. No Flask maintainer has curated or checked the snippets for security, correctness, or design.
@app.route('/set_cookie') def cookie_insertion(): redirect_to_index = redirect('/index') response = current_app.make_response(redirect_to_index ) response.set_cookie('cookie_name',value='values') return response
This snippet by liuliang can be used freely for anything you like. Consider it public domain.