Closed (won't fix)
Project:
Drupal core
Version:
5.1
Component:
user system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Apr 2007 at 08:01 UTC
Updated:
12 Nov 2010 at 10:32 UTC
i've been tracking this down to:
if you try to read a value from the session that is not stored there (sess_write()) you will get logged out.
demo:
// log in as a user, then in a module do:
sess_read(time());
// call that page,
// reload page .. now you should be logged out.
F
Comments
Comment #1
ajessup commentedWe've noticed this too on a 5.1.7 codebase.
Comment #2
damien tournoud commentedI don't see any bug in this. sess_read() is a private core function, that you should not call directly.
Comment #3
avpadernoIf it's private then it should be renamed to
_sess_read(); at least it would be obvious it's a private function.Comment #4
damien tournoud commentedAlready done in D7.
Comment #5
avpadernoThe report is for Drupal 5.
Comment #6
damien tournoud commentedDrupal 5 and 6 are API frozen.
Comment #7
eric at nrd commentedI was bitten by this behavior in D6. It isn't immediately obvious that using sess_write() and sess_read() inside a module are incorrect (changing them to _sess_write() and _sess_read() in D7 sounds like a good plan).
If you need to read or write to the session, I believe that in D6 the preferred method is to use the $_SESSION[] superglobal variable as follows:
Comment #8
smith2008 commentedYeah private should be PRIVATE. Supper global should be wrapped in something, so we can say this is the drupal api functionality.
Comment #9
damien tournoud commentedThere is nothing to do here. Those functions are already marked as private in Drupal 7. Drupal 5 and 6 are API frozen so nothing can be done there. The super-globals are a standard PHP feature, can and should be used directly.