Closed (outdated)
Project:
Memcache API and Integration
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Apr 2009 at 16:52 UTC
Updated:
15 Apr 2026 at 01:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
matt_paz commented+1
Comment #2
jeremy commentedThe attached patch fixes this by looking up the memcache session by first retrieving the user object from memcache. It then uses this object to destroy the session. Please test.
Comment #3
jeremy commentedWhoops -- the previous patch had a typo. This one should work. Please test.
Comment #4
jeremy commentedThere was a code path where the session id wasn't saved in the user object, causing the sess_destroy_uid() to fail. The attached patch is updated to fix this. It works in all my testing.
Comment #5
jeremy commentedCommitted.
Comment #6
jeremy commentedLink to the commit for reference:
http://drupal.org/cvs?commit=237454
Comment #7
doq commentedOnly one user session (probably latest) gets deleted.
Comment #8
darren ohThis could be fixed by storing an array of session IDs in the user object.
Comment #9
catchThis is related to #791888: sess_destroy_sid() does not remove the session cookie from the user's browser.
Comment #10
darren ohThis still needs to be fixed for situations where a user has multiple browsers, each with a different session.
Comment #11
darren ohPatch for anyone else who still uses Drupal 5.
Comment #12
darren ohModified to prevent accumulation of dead sessions in the user object.
Comment #13
quotesbro commented#12 looks reasonable, I applied it on production site
Comment #14
premanup commentedAs far as I can see if someone updates user's status or password then function filter_user() in memcache-session.inc is called before sess_destroy_uid(). See the user_save() in user.module:
Therefore when function dmemcache_get($uid, 'users') is called in sess_destroy_uid() it can't get $user object ($user == false). Therefore dmemcache_delete($sid, 'session') is not called at all and all session information stay in the session bin.
If I comment out line cache_clear_all($account->uid, 'users') in filter_user() then patch works as expected.
Comment #15
premanup commentedI changed $op in filter_user() from 'update' to 'after_update'. It solves the problem. Here is the new patch.
Comment #16
japerry