#33522: Unexpected behaviour when logging in
-------------------------------------+-------------------------------------
     Reporter:  Michael              |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.auth         |                  Version:  4.0
     Severity:  Normal               |               Resolution:
     Keywords:  authentication log   |             Triage Stage:
  in CSRF token                      |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Michael:

Old description:

> Say a user opens two tabs to the same site, both show the login page.
>
> The user logs in on Tab A, does some things, after a while changes to Tab
> B, sees the login page, and instictively clicks login (their details pre-
> populated due to auto fill). They will then get a surprising CSRF error.
>
> I thing this is because when they logged in on Tab A, it deleted the
> anonymous session, and replaced it with a new session, which means the
> CSRF token from Tab B fails.
>
> Would it not be better to not delete the anomyous session when one logs
> in, or upgrade the session (instead of deleting it)?

New description:

 Say a user opens two tabs to the same site, both show the login page.

 The user logs in on Tab A, does some things, after a while changes to Tab
 B, sees the login page, and instictively clicks login (their details pre-
 populated due to auto fill). They will then get a surprising CSRF error.

 I thing this is because when they logged in on Tab A, it deleted the
 anonymous session, and replaced it with a new session, which means the
 CSRF token from Tab B fails.

 Would it not be better to not delete the anomyous session when one logs
 in, or upgrade the session (instead of deleting it)?

 Another idea is making the login view `csrf_exempt`, then we won't have
 these csrf errors.

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33522#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.251f72a485a9681239abb627f42b2430%40djangoproject.com.

Reply via email to