Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#30714 closed New feature (wontfix)

Add a system check against SESSION_EXPIRE_AT_BROWSER_CLOSE and SESSION_COOKIE_AGE both being set

Reported by: Adam Johnson Owned by: nobody
Component: contrib.sessions Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The two settings SESSION_EXPIRE_AT_BROWSER_CLOSE and SESSION_COOKIE_AGE are mutually exclusive. If a user has set both of them, they should be warned with a system check.

Change History (4)

comment:1 by Carlton Gibson, 5 years ago

Resolution: wontfix
Status: newclosed

I'm not sure about this.

SESSION_COOKIE_AGE defaults to two weeks. (OK, one thinks). I don't touch that. I simply enable SESSION_EXPIRE_AT_BROWSER_CLOSE and all of a sudden I get a warning?

That seems less than ideal.

Either we need to rationalize these settings somehow. (Maybe SESSION_COOKIE_AGE == 0 entailing SESSION_EXPIRE_AT_BROWSER_CLOSE?) Or accept that whilst related they're not strictly interdependent.

Happy to think about it, but a decision is needed first no? Going to say wontfix plus possible discussion on DevelopersMailingList for that reason. Happy to reopen later if we can come up with something.

comment:2 by Adam Johnson, 5 years ago

The check can use settings.is_overridden to check that the user has set it, rather than it being the default coming from the global settings file :)

I posted this ticket because it happened to me, found a project that had both configured and it wasn't clear which was intended by the original developer.

comment:3 by Carlton Gibson, 5 years ago

Yeah... still not convinced they're contraries. SESSION_EXPIRE_AT_BROWSER_CLOSE tumps whatever value you have for SESSION_COOKIE_AGE, so if you set, you meant that. I'm not at all convinced we need a system check here.

comment:4 by Adam Johnson, 5 years ago

I think the confusion was that the behaviours don't combine. You can't have a session that is maximum 30 minutes but also disappears if the browser is closed. The docs could be clearer but I think a check is the easiest way to prevent such misconfiguration,

Note: See TracTickets for help on using tickets.
Back to Top