title: Flask session don't persist data
body: <p>I have a Javascript application and a Flask application. When the user send data from Js to Flask, I store it on <code>session</code> and it works fine at a specific route:</p>
  
  <pre><code>@app.route(...)
  def user(...):
      session['name'] = name
  
      print(session['name']) # Works !
  </code></pre>
  
  <p>But when I tr to get the values on session from another method / route the session is empty:</p>
  
  <pre><code>@app.route(...)
  def current():
      print(session.keys(), session.values) # Empty !
  </code></pre>
  
  <p>I have installed <a href="https://pythonhosted.org/Flask-Session/" rel="noreferrer">Flask Session</a> and set the config to:</p>
  
  <pre><code>'SECRET_KEY': b'...',
  
  'SESSION_TYPE': 'filesystem', # Memcache, null and redis
  
  'SESSION_PERMANENT': False, # True
  </code></pre>
  
  <p>And then started the Flask application and it not work. I have also try to set <code>session.modified = True</code> after I add some new value to session and still not work.</p>
  
  <p>I have read lots of threads on Stack Over Flow, Reddit, etc; and nothing worked. Tips please ?</p>