Reputation: 239
I've written a django application, and put it on a CentOS server. It is definitely okay when I use django development web server.
Such as I start it by "python ./manage.py runserver", and access that server from browser on another computer. I can sign in one time, and access all the pages without issues.
However when I run it with apache+mod_wsgi, I just found I have to login with user and password time by time. I think maybe there is some problem with the session middleware, so, how can I find the root cause and fix it?
Upvotes: 1
Views: 2186
Reputation: 80031
There are a couple of different options for this.
In order of likelyhood (imho):
locmem
cache backendStoring the session in the cache is only a good solution if you use memcached as the cache backend. So if you're storing the sessions in cache, make sure you use memcache :)
Either way, check if SESSION_ENGINE
is set to django.contrib.sessions.backends.db
Upvotes: 2