@app.route("/login", methods=["POST", "GET"])
def login():
session["user_id"] = 9
print(session.get("user_id")) //Output: 9
@app.route("/add", methods=["POST")
def add():
print(session.get("user_id")) //result is None
I don’t know why this happen, I’ve try to config everything but still not work. I’m working with React and Flask.
New contributor
Huy Nguyen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.