wlmac / metropolis

William Lyon Mackenzie's online hub for announcements, calendar events, clubs, and timetables
https://maclyonsden.com
GNU Affero General Public License v3.0
21 stars 6 forks source link

Remember Me Isn't Working #160

Closed nyiyui closed 1 year ago

nyiyui commented 2 years ago

logged out whenver the network is changed and there is a new session (maybe only app) when rememberme option is used

JasonLovesDoggo commented 1 year ago

not sure but it doesn't seem like the option is used on the site https://github.com/wlmac/metropolis/blob/ffa9b76128132a038a6e9467bc0aa84ac7d535f1/templates/account/login.html#L59

JasonLovesDoggo commented 1 year ago

after a closer look it seems like set_expiry(0) deletes the cookie on session end, I will write a custom login class to fix this. https://docs.djangoproject.com/en/4.1/topics/http/sessions/#django.contrib.sessions.backends.base.SessionBase.set_expiry

nyiyui commented 1 year ago

Oh, that's interesting…I guess I should read the docs… Maybe we can just set expiry to e.g. 1 year instead of making a subclass

On Fri, Feb 10, 2023 at 7:25 PM Jason @.***> wrote:

after a closer look it seems like set_expiry(0) deletes the cookie on session end, I will write a custom login class to fix this.

https://docs.djangoproject.com/en/4.1/topics/http/sessions/#django.contrib.sessions.backends.base.SessionBase.set_expiry

— Reply to this email directly, view it on GitHub https://github.com/wlmac/metropolis/issues/160#issuecomment-1426528614, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5PL6IXSIHCX4Z7JWVDYVLWW3MABANCNFSM5J6KYESA . You are receiving this because you were assigned.Message ID: @.***>

JasonLovesDoggo commented 1 year ago

.g. 1 year instead of making a subclass we we 100% could I'm just not sure what else SESSION_COOKIE_AGE effects so I didn't wan't to mess anything up but I can just revert the commit and do that

JasonLovesDoggo commented 1 year ago

Fixed.