title: Flask session and multiple users
body: <pre><code>@app.route('/login', methods = ['GET', 'POST'])
  def login():
     if request.method == 'POST':
        session['username'] = request.form['username']
        return redirect(url_for('index'))
     return '''
  </code></pre>
  
  <p>This is the "template" for a flask session login. My question is,</p>
  
  <pre><code>'username'
  </code></pre>
  
  <p>is mapped to <strong>only one</strong> value which is the <code>request.form['username']</code></p>
  
  <p>So what if I have two users login, </p>
  
  <pre><code>(1) 'jack' 
  </code></pre>
  
  <p>So now <code>session['username'] = jack</code></p>
  
  <p>And then</p>
  
  <pre><code>(2) 'davis'
  </code></pre>
  
  <p>So now <code>session['username'] = davis</code></p>
  
  <p>But then jack is not logged in anymore. How do I do this?</p>