1、cookie

# 设置
response=Response('hello')
response.set_cookie(key, value)
return response
# 获取
request.cookie.get(key)

2、session

flask session默认保存到cookie中(原因: 默认没有ORM),要想实现保存到服务器中,需要借助第三方组件flask-session

注意:只使用session的时候需要在配置文件中添加(不推荐这么使用)

SECRET_KEY  =  字符串

flask-session的使用:三步走战略

链接: https://www.cnblogs.com/wt7018/p/11605411.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2022-01-04
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
相关资源
相似解决方案