title: Flask session lost data
body: <h1>I am testing a simple app to store data in session. I created the check to avoid resetting, but still getting data lost. Here is my code of app.py:</h1>
  
  <pre><code>from flask import Flask,render_template,request,session
  from flask_session import Session
  
  app = Flask(__name__)
  
  app.config["SESSION_PERMANENT"] = True
  app.config["SESSION_TYPE"] = "filesystem"
  Session(app)
  
  @app.route("/",methods=["POST","GET"])
  def index():
      if session.get("notes") is None:
          session["notes"] = []
      if request.method == "POST":
          note = request.form.get("note")
          session["notes"].append(note)
      return render_template("notes.html",notes=session["notes"])
  </code></pre>
  
  <p>================================================================</p>
  
  <p>Any time I am posting a new info from form, it gets overwrites the old one. seems session got reset.</p>
  
  <p>Any idea why it happened? </p>
  
  <p>Thanks,
  vardan</p>