Closed (fixed)
Project:
Remember me
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
4 May 2007 at 17:51 UTC
Updated:
16 May 2009 at 10:30 UTC
1) Install remember_me.module on Drupal 4.7.6
2) Log in but do NOT check the "Remember me" box
3) Go to administer/logs
4) Change Filter by message type: and hit the Filter button.
5) Change is lost and reverts to "all messages"
Another bug: Similarly, if I attach a file to a page and hit Submit, nothing happens and the filename field is cleared.
Both problems go away if the "Remember me" box is checked when I log in.
I think somehow the $_SESSION variables are getting reset. I'll bet a bunch of other things are broken too.
(It looks like remember_me_init() repeatedly calls _remember_me_set_lifetime(0); but the value keeps reverting to 2000000.)
Comments
Comment #1
scott.mclewin commentedI've just found a variation on what I believe is the same root cause as this issue. My site, www.folkjam.org, maintains $_SESSION variables that keep track of where the user is currently looking for content (we use that to only display content within a radius around the user's location).
When a user logs into the site without the 'remember me' checkbox set, none of the session variables we set survive across page loads - they all get set to their default values.
I think the culprit is in remember_me_init(), where the logic flow causing this particular scenario is:
That call to _remember_me_set_lifetime(0) clears out anything set in $_SESSION by any other module. I'd be interested in understanding the intended logic flow from this as I'm certain it was done because of a specific case (or cases) that needed to be covered. Making my site work again was as easy as removing the _remember_me_set_lifetime(0) call and the if statement around it - but I want to know what else this might break and whether this is a complete solution before rolling you a patch.
Comment #2
scott.mclewin commentedChanging the title to reflect the broader issue - hope that's ok markdionne
Comment #3
doq commentedComment #4
doq commentedCan you send me some of your modules that refuse to work with remember_me module?
Comment #5
doq commented2 markdionne:
Works for me in IE and Firefox on Drupal 5.1. Change gets lost only if I close and reopen browser.
Comment #6
doq commentedWhat browsers you use?
Give me your phpinfo please.
Comment #7
markdionne commentedI see the problem on both IE6.0.2900.2180 and Firefox 2.0.0.4.
The problem is happening with the standard watchdog module, so there is no need to send you "a module that refuses to work".
With Drupal 4, the problem has been happening 100% of the time.
Now that I have switched to Drupal 5, the problem seems intermittent.
The entire phpinfo output is a bit long to post here. Here's an excerpt.
I'm using PHP 4.3.9 Apache/2.0.52 (Red Hat)
session
Session Support enabled
Registered save handlers files user
Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /var/lib/php/session /var/lib/php/session
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid Off Off
Comment #8
markdionne commented1) Install remember_me.module on Drupal 5.1
2) Log in but do NOT check the "Remember me" box
3) Go to administer/Content Management/Content (/admin/content/node)
4) Change the "status" dropdown menu and click "Filter".
5) Change of "status" reverts to previous setting an no filtering happens
Comment #9
markdionne commentedOops, I changed the title globally by mistake. Changing it back.
Comment #10
scott.mclewin commented@doq - My experiences are right in line with Mark's as far as 4.7 goes, where the problem happens all of the time. We are busy moving folkjam to D5 now and I don't have experience with remember_me for D5 yet.
You can get the behavior with any standard module that uses $_SESSION, such as enabling file uploads on a node type. As a test, modify your local copy of the remember_me module to stash a test value in $_SESSION, such as
$_SESSION['my_test_value'] = time();
and print it out as part of your page.tpl.php somewhere in the header so it is visible on each page. I've not done this particular test, but given the behavior that Mark and I have both seen, I suspect that this will reproduce the problem on Drupal 4.7.
Scott
Comment #11
markdionne commentedConsider switching to persistent_login module. I am told that Persistent Login does not have this problem.
Comment #12
scott.mclewin commentedThanks Mark - the switch is under way now. I like that module's solution better than jacking with session lifetimes too.
As a module maintainer myself I know that at times life gets in the way of handling the issue queue - hopefully doq's schedule allows him/her to give remember me a little attention soon, or formally shut it down in favor of other modules.
Scott
Comment #13
ms2011 commentedExperiencing the same problem.
For me, it was causing this issue: http://drupal.org/node/155726
Agreed that the logic in this module could be better commented. No way to fix without understanding the reasoning behind it. Switching to persistent login module...
Comment #14
markdionne commentedAs of Drupal 5.5, this issue is only partly fixed. For example, filtering of users at /admin/user/user is still broken when remember_me is active, while filtering on the logs page seems to be fixed. (The version of remember_me is 1.8.4.1).
Comment #15
nickl commentedKindly review and test this patch as a solution to this problem.
Comment #16
nickl commentedDuplicate issue: http://drupal.org/node/233046
Comment #17
nickl commentedClosing duplicate issue