title: Django rest framework, JWT and request.session
body: <p>I use Django rest framework with JWT for authentication and everything works perfectly BUT...
  I need to save an information about the user in a session var at login and I really don't know where I can do the request.session['mydata'] = plop</p>
  
  <p>I tried :</p>
  
  <pre><code>def jwt_response_payload_handler(token, user=None, request=None):
    serializedUser = UserSerializer(user).data
    request.session['mydata'] = serializedUser.mydata
    return {
      'token': token,
      'user': serializedUser
    }
  </code></pre>
  
  <p>But it doesn't work...</p>
  
  <p>Any idea ?</p>