title: Error creating a multi-step form using Django session
body: <p>I'm currently working on building a multi-step registration form in Django. I followed the official documentation which can be seen <a href="https://docs.djangoproject.com/en/3.1/topics/http/sessions/#setting-test-cookies" rel="nofollow noreferrer">here</a>. Although the forms do not show any error, the user does not get created. Is there a problem I might be overlooking?</p>
  <pre><code>def signup_step_one(request):
      if request.user.is_authenticated:
          return HttpResponseRedirect(reverse('accounts:personal-signup'))
      else:
          if request.method == 'POST':
              form = CustomUserCreationForm(request.POST)
              if form.is_valid():
                  # collect form data in step 1
                  email = form.cleaned_data['email']
                  password = form.cleaned_data['password1']
  
                  # create a session and assign form data variables
                  request.session['email'] = email
                  request.session['password'] = password
                  
                  return render(request, 'personal-signup-step-2.html', context={
                      'form': form,
                      &quot;title&quot;: _('Create your personal account | Step 1 of 2'),
                  })
          else:
              form = CustomUserCreationForm()
      return render(request, 'personal-signup-step-1.html', {
          &quot;title&quot;: _('Create your personal account | Step 1 of 2'),
          'form': form,
      })
  
  
  def signup_step_two(request):
      # create variables to hold session keys
      email = request.session['email']
      password = request.session['password']
  
      if request.method == 'POST':
          form = CustomUserCreationForm(request.POST)
          if form.is_valid():
              user = form.save(commit=False)
              user.email = email
              user.set_password(password)
              user.first_name(form.cleaned_data['first_name'])
              user.last_name(form.cleaned_data['last_name'])
              user.save()
              print('user created')
          return HttpResponse('New user created')
      else:
          form = CustomUserCreationForm()
      return render(request, 'personal-signup-step-2.html', {
          &quot;title&quot;: _('Create your account | Step 2 of 2'),
          'form': form,
      })
  </code></pre>