Subclass django.contrib.sessions.middleware.SessionMiddleware,
overriding process_request.
Determine whether you should or should not initiate a session from the
request object, and if you should, call the super class's
process_request method.
Replace django.contrib.sessions.middleware.SessionMiddleware in
settings.MIDDLEWARE_CLASSES with your replacement one.
Simples.
Cheers
Tom
Hi Tom,
Thanx for your help. That sounds like a very good approach.
I assume I have to put some dict-like object on the request to avoid
all kinds of attribute errors?
Regards, Jan
FWIW, sessions should only be written to the DB if they are modified,
and you can avoid that by checking User.is_authenticated first.