title: How to retrieve session data with Flask?
body: <p>I have flask+wtforms application. I can see in login() 
  user object stored as </p>
  
  <pre><code>  if user:
     if user.verify_password(form.password.data):
      flash('You have been logged in')
      user.logins += 1
  
      db.session.add(History(user.uid))
      db.session.commit()
  
      session['user'] = user
  </code></pre>
  
  <p>Now I wanted to retrieve the user </p>
  
  <pre><code>if 'user' in session:
         User=session.get('user')
         print User.nickname ###&lt;&lt; how to retrieve specific object member?
  </code></pre>
  
  <p>It fails with message like :</p>
  
  <pre><code>Instance &lt;User at 0x8e5a64c&gt; is not bound to a Session; attribute refresh operation cannot proceed
  </code></pre>