📜  烧瓶设置 cookie - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:55.578000             🧑  作者: Mango

代码示例1
@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')