On Fri, Aug 21, 2009 at 9:10 PM, Florian
Schweikert<kelvan.mailingl...@gmail.com> wrote:

> In summary:
> * On the server (etch) session flushes by request.user.is_authenticated()
> (e.g session.user switched to anonymous without any findable reason) after a
> while equal if session still marked active in database and cookie.
> * On Ubuntu exactly the same application changing the key every request but
> session in cookie is still the first key.
> * There is no difference if I use Django-server instead of Apache.

The good news is that this is Python and it is open source, so you
have all the tools you need to diagnose the problem. The great news is
that you can reproduce the problem with the development server, so you
won't have to jump through hoops to debug the problem.

Some pointers into the source code:
django/contrib/auth/__init__.py: login() - this is the method that
logs you in, and sets the cookie that acts as the session key. It's
also responsible for flushing the session if a non-matching user-id is
found.

django/contrib/sessions/middleware.py - this is the module that
defines the session middleware. This is the code that looks for the
session cookie, and constructs the Session object based on the data
retrieved from the database for that session. It also ensures that the
Session data is written back when the response is handed back.

django/contrib/sessions/backends/base.py - this is the core
implementation of session itself if you need to dig into how and when
session data is saved.

I'd love to offer more help, but in this case, there is _literally_
nothing else I can do. The only person who is having this problem is
you. Outside of the conditions I explained earlier, plus the
pathological case where you have cookies turned off or something is
eating your cookie jar, I haven't ever seen this behaviour in Django.

I can appreciate that this is frustrating, but if you want to solve
this, you're going to need to crack open PDB - or even just put lots
of print statements in the code - until you can establish when the
cookie is changing. Hopefully we can both learn something from the
experience - if you have found a genuine bug in Django, we're
certainly keen to fix it. However, in order to fix it, we have to know
what it broken.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to