django-redis
django-redis copied to clipboard
Session expiration time
Hi,
I started using this for caching sessions in my project, but an issue I have is that they expire a bit too quickly and the users constantly have to log back in. Any way to set the expiration time for them?
SESSION_COOKIE_AGE? https://docs.djangoproject.com/en/4.0/topics/http/sessions/#browser-length-sessions-vs-persistent-sessions
It is set to the default 2 weeks but it expires multiple times per day.
It seems very strange to me, so I advise to take a look at expiration time using TTL command
or trying django.contrib.sessions.backends.cache_db or django.contrib.sessions.backends.db.
django-redis does not implement anything on top of django's session backends so this behaviour is implemented in django itself.
Did you add any other SESSION_* variable in settings?
please paste here any settings for cache and session to make it easy to understand the problem
@rpop0 any news about this? otherwise in a week or so I will close this
No news about this, everything seems to be set correctly, but the sessions still expire prematurely.
Have you made the tests I suggested? Can you share cache related settings? Can you reproduce the issue elsewhere (demo application)?