Also worthy of note: I've seen this happen also with
SESSION_SAVE_EVERY_REQUEST = True

On Feb 22, 11:34 pm, "Aryeh Leib Taurog" <v...@aryehleib.com> wrote:
> I'm seeing a very strange intermittent problem with logging in.  The login
> appears to be successful, because the response to the login POST is a 302
> redirect.  However sometimes the user doesn't seem to be stored in the
> session.
>
> Here's a snippet from my http access log where my testing app was
> redirected to a page which generates an error if the specified user isn't
> logged in:
>
> "POST /accounts/login/?next=/check_login/logintest/ HTTP/1.1" 302
> "GET /check_login/logintest/ HTTP/1.1" 500
>
> This happened 14 consecutive times yesterday and then it started working
> again.
>
> I compared the data collected on the server with the http headers logged
> by the client and I can see that the cookies are transmitted correctly.  I
> can retrieve the session records using manage.py whois, but it reports "No
> user associated with session."  In some of the error cases the raw session
> data is empty and in some cases it looks like this:
> {'testcookie': 'worked'}
>
> I see a few old threads that seemed to describe such a problem, but no
> resolution is mentioned there.  I wonder if anyone has successfully
> diagnosed and rectified a similar problem?  Any help getting this fixed
> would be very appreciated!
>
> Thanks,
> Aryeh Leib
>
> I'm running:
> django 1.2.4
> python 2.6.5 (ubuntu 10.4)
> lighttpd 1.4.26 via fcgi (with flup)
> postgresql 8.4 via psycopg2 (2.0.13-2ubuntu2)
>
> session engine is db (all session-related settings are default)
> The login view is django.contrib.auth.views.login
>
> MIDDLEWARE_CLASSES = (
>     'django.middleware.common.CommonMiddleware',
>     'django.contrib.sessions.middleware.SessionMiddleware',
>     'django.middleware.csrf.CsrfViewMiddleware',
>     'django.middleware.locale.LocaleMiddleware',
>     'django.contrib.auth.middleware.AuthenticationMiddleware',
>     'django.contrib.messages.middleware.MessageMiddleware',
>     'django.middleware.doc.XViewMiddleware',
>     'django.middleware.transaction.TransactionMiddleware',
>      ...
> )
>
> INSTALLED_APPS = (
>     'django.contrib.auth',
>     'django.contrib.contenttypes',
>     'django.contrib.sessions',
>     'django.contrib.messages',
>     'django.contrib.admin',
>     'django.contrib.humanize',
>     'django.contrib.admindocs',
>     'django_extensions',
>     ...
> )

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

  • Login failing Aryeh Leib Taurog
    • Re: Login failing Aryeh Leib Taurog

Reply via email to