Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Remember me" is not setting an expiration date and time for session cookies in MODX 3.0 #16518

Open
SnowCreative opened this issue Feb 4, 2024 · 3 comments
Labels
bug The issue in the code or project, which should be addressed.

Comments

@SnowCreative
Copy link
Contributor

Bug report

Summary

The "remember me" checkbox in MODX 3.0 has no effect.

Step to reproduce

Set "session_cookie_lifetime" to a long number, like 604800 (one week). Check off "Remember Me", log in, then quit your browser. Come back after that time, and go to the manager.

Observed behavior

You don't get automatically logged in. I checked the session cookie info and no expiration date and time are set. Checking the cookie for 2.8 sites shows the expiration date and time do get set.

Environment

MODX 3.0.4.

@SnowCreative SnowCreative added the bug The issue in the code or project, which should be addressed. label Feb 4, 2024
@modxcommunity
Copy link
Collaborator

This issue has been mentioned on MODX Community. There might be relevant details there:

https://community.modx.com/t/restricting-front-end-session-time/7486/9

@halftrainedharry
Copy link
Contributor

The problem seems to be here in the code:

$this->rememberme = ($this->getProperty('rememberme', false) === true);

$this->getProperty('rememberme') returns a value of "1" when the checkbox "Keep me logged in ..." is checked on log in.
With the triple equal sign comparison operator (===), "rememberme" is always false.

@SnowCreative
Copy link
Contributor Author

Yes, changing that to double equal sign does the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue in the code or project, which should be addressed.
Projects
None yet
Development

No branches or pull requests

3 participants