我已经为messenger开发了chatbot并在heroku中部署了。当用户写入(信使发送帖子请求)我尝试设置会话,但在请求后,会话为空。邮差我测试过,一切都很完美。我想知道是什么原因? 以下是我设置会话的方式:
from flask import Flask, request, session
@app.route('/set', methods=['POST'])
def set():
session["language"] = "en"
print(session) //<SecureCookieSession {'language': 'en'}>
return "added", 200
@app.route('/get', methods=['POST'])
def get():
print(session) //in messenger <SecureCookieSession {}> in postman <SecureCookieSession {'language': 'en'}>
return "get"