Closed (outdated)
Project:
Masquerade
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Nov 2017 at 14:13 UTC
Updated:
18 Apr 2026 at 11:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
glynster commentedAgreed, did you get any headway with this?
Comment #3
aclebson commentedMe too, do we have any news about this?
Comment #4
aclebson commentedGuys, forget about "last access", you can use the data "login" to know when the user made the last login, I mean, that data is updated just by a real authentication.
Cheers
Comment #5
glynster commented@aclebson you rock-star, made the change and it works perfectly for our needs!!
Comment #6
megachrizNot overwriting the last access value might only be possible with hacking the 'session_write_interval' variable.
From
_drupal_session_write()in includes/session.inc:So if we can manage to temporary set 'session_write_interval' to REQUEST_TIME upon masquerading, we might be able to prevent last access from being overwritten. I think it is safe to hijack this variable, in Drupal core I only see this variable mentioned in
_drupal_session_write()and in an automated test.Comment #7
megachrizI think that this patch will do the trick. At least it does with my initial testing.
I tested the patch myself in the following way:
Comment #8
mrcharles commented@MegaChriz - Good man...this patch worked a treat for me too. Thanks.
Comment #9
possibriThank you!
Comment #10
izmeez commented@mrcharles & @possibri Can either of you change the status to RTBC?
Comment #11
possibriComment #12
andypostnice workaround, but to be commitable it needs configuration
Comment #13
andypostComment #14
ressaThanks for reporting this. In an attempt to help the maintainers, I am going through some of the Drupal 7 issues, and closing them, since Drupal 7 is EOL.
Maintainers should grant credit for the great work to the relevant users, even if the patch did not get committed: https://www.drupal.org/docs/develop/issues/issue-procedures-and-etiquett....
This was fixed in modern Drupal via #3042321: Last access by a user should not change after masquerade as that user (D8).
Since Drupal 7 is EOL, we can probably close this issue, but feel free to re-open if this is still relevant.