Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Allauth seems to log user out after a few days of inactivity

When a user logs in, I want the user to stay logged in indefinitely unless of course they themselves prompt the log out.

What seems to be the case with my website (using django-allauth for authentication) is that when a user logs in and then doesn't go on the website for a few days (haven't tested exactly how many days) it loses their authentication and they're no longer logged in.

I want the authentication state to be permanent and not expire.

Can someone explain this please and tell me how to achieve what i want.

tried looking into session cookie expiry and researching defaults. Haven't got far.

like image 870
SkyBlue Avatar asked May 15 '19 11:05

SkyBlue


1 Answers

It seems you're looking for this setting (django-allauth):

ACCOUNT_SESSION_REMEMBER (=None)

Controls the life time of the session. Set to None to ask the user (“Remember me?”), False to not remember, and True to always remember.

You might want to combine this with a considerable large SESSION_COOKIE_AGE.

like image 173
Raydel Miranda Avatar answered Oct 19 '22 21:10

Raydel Miranda