@app.route('/cookies/set')
def set_cookies():
 cookies = dict(request.args.items())
 r = app.make_response(redirect(url_for('view_cookies')))
 for (key, value) in cookies.items():
  r.set_cookie(key=key, value=value, secure=secure_cookie())
 return r

@ app . route ( '/cookies/set' ) def set_cookies ( ) : cookies = dict ( request . args . items ( ) ) r = app . make_response ( redirect ( url_for ( 'view_cookies' ) ) ) for ( key , value ) in cookies . items ( ) : r . set_cookie ( key = key , value = value , secure = secure_cookie ( ) ) return r
sets cookie(s) as provided by the query string and redirects to cookie list .