title: Get Session Data in Django Forms
body: <p>Given a Django form, I have the following <code>save()</code> method:</p>
  
  <pre><code>def save(self):
      name = self.cleaned_data.get('name', None)
  
      user = User.objects.get(1) #I want the session user ID from here
  </code></pre>
  
  <p>So to do so I imported as so:</p>
  
  <pre><code>from django.http import HttpRequest as request
  </code></pre>
  
  <p>and in the above code I wrote</p>
  
  <pre><code>request.session.get('user_id') #for example
  </code></pre>
  
  <p>However, when run, Django throws the following error:</p>
  
  <pre><code>AttributeError: type object 'HttpRequest' has no attribute 'session'
  </code></pre>
  
  <p>Is there a better way to do this retrieval?</p>