设置 cookie
from flask import Flask,make_response
@app.route("/add/")
def Add():
response = make_response("hello lucax")
response.set_cookie("name",'lucax',20) #20秒后cookie自动消失, #如果不设置有效时间20秒,那么浏览器关闭就消失了
return response
其他操作见: https://www.cnblogs.com/derek1184405959/p/9103730.html