I want to check if a value, for example the 'name' value, exists in a session in a Flask application I made, but it's not working. Python: @app.route("/add/<string: name>") def add(name): session["list"].append(name) return "Successful" @app.route("/list def list(): cursor=mysql.connection.cursor() query="Select * From data where id=1" cursor.execute(query) data=cursor.fetchone() return render_template("list.html",data=data) HTML: {% if data.name in session["list"] %} There is {% else %} None {% endif %} Even if the data.name value is in the session, it goes into the else block Continue reading...