#6246 - Login failure after expired session
| Identifier | #6246 |
|---|---|
| Issue type | Trivial issue (does not break functionality) |
| Title | Login failure after expired session |
| Status | Completed |
| Tags |
Roadmap: v11 (custom) |
| Handling member | PDStig |
| Version | 11 beta8 |
| Addon | core |
| Description | The following error is thrown when logging in after session expires:
Composr startup error Call to undefined function attach_message(). #0 sources/users_active_actions.php(231): create_session() #1 sources/users.php(108): handle_active_login() #2 sources/global2.php(472): handle_logins() #3 sources/global.php(282): init__global2() #4 sources/global.php(1562): require_code() #5 sources/bootstrap.php(208): require_once('...') #6 adminzone/index.php(57): require_code__bootstrap() #7 {main}. Completely refreshing the URL and logging in does not result in the error. |
| Steps to reproduce | Allow any user session to idle out then login via the resulting form or click any login link. |
| Additional information | Environment:
Ubuntu 22.04.5 LTS Apache/2.4.52 (Ubuntu) mysql Ver 15.1 Distrib 10.6.22-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper PHP 8.1.2-1ubuntu2.22 |
| Funded? | No |
| Commits |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
attach_message is sometimes not yet defined when creating a new session. This is triggered when detecting geo-location mismatch between a user's IP address and the region they set on their profile.
This fix adds a check to skip attaching a message if the function has not yet been loaded.
Additionally, the geo-location check will also now happen (and show a warning for a mismatch) when editing profile settings. That way, the user knows and can easily fix it right there in their profile settings.