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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With