title: Get request.session from a class-based generic view
body: <p>Is there a way to get <code>request.session</code> from inside a class-based view? </p>
  
  <p>For instance, I have </p>
  
  <pre><code>from django.views.generic.edit import FormView
  
  class CreateProfileView(FormView):
      def form_valid(self, form):
          # --&gt; would like to save form contents to session here
  
          return redirect(self.get_success_url())
  </code></pre>
  
  <p>The only thing I can think of would be override <code>as_view</code> by adding </p>
  
  <pre><code>def as_view(self, request, *args, **kwargs):
      self.session = request.session
      super(CreateProfileView, self).as_view(request, *args, **kwargs)
  </code></pre>
  
  <p>to the class. But that seems ugly. Is there another way?</p>