Django, mod_python, apache and wacky sessions
You are correct about how Apache handles the processes, and sometimes you'll get served by a different process.  You can see this when you make a change to your site; new processes will pick up the change, but old processes will give you the old site.  To get consistency, you have to restart Apache.
Assuming a restart doesn't fix the problem, I would guess it's something in the "custom authentication backend" storing part of the authentication in memory (which won't work very well for a web server).  I would try setting MaxRequestsPerChild to 1 in your Apache config and seeing if you still get the login screen.  If you do, something is being stored in memory, maybe a model not being saved?
Hope that helps!
P.S. Just out of curiosity, why are you using a custom authentication backend and a middleware to ensure the user is logged in?  It seems Django's contrib.auth and @login_required would be easier...
I am running a Django through mod_python on Apache on a linux box. I have a custom authentication backend, and middleware that requires authentication for all pages, except static content.
My problem is that after I log in, I will still randomly get the log in screen now and again. It seems to me that each apache process has it's own python process, which in turn has it's own internals. So as long as I get served by the same process I logged in to, everything is fine and dandy. But if my request gets served by a different apache process, I am no longer authenticated.
I have checked the HTTP headers I send with FireBug, and they are the same each time, ie. same cookie.
Is this a known issue and are there workarounds/fixes?
Edit: I have a page that displays a lot of generated images. Some off these will not display. This is because they are too behind the authenticating middleware, so they will randomly put up a login image. However, refreshing this page enough times, and it will eventually work, meaning all processes recognize my session.