Closed (outdated)
Project:
Memcache API and Integration
Version:
6.x-1.10
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Dec 2008 at 00:03 UTC
Updated:
6 Mar 2026 at 12:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
andreiashu commentedYup, i can replicate this bug
Edit: I tested on the 6.x version.
Comment #2
jeremy commentedThis bug also strikes if you try and edit your own user account. For example, edit your username and note that your user block's title doesn't change, still showing the old username.
When a user account is edited, or the show/hide descriptions link is clicked, the changes to the user are updated with a call to user_save(). However, user_save() does not update the global $user object, as it can be used to update the current user or a different user. In sess_write(), we update the 'users' cache table with the global $user object, and thus these changes are not saved in memory. You only see these changes if you log out and log back in, causing the 'users' cache entry for your user account to be rebuilt.
The attached patch modifies the user.module, which is obviously not the right way to do this. A better solution would be to create a module, perhaps memcache-session.module, and implementing hook_user(), flushing the appropriate users cache when 'after_update' is invoked. However, I'm hoping to get more eyes on this first. Thoughts?
Comment #3
jeremy commentedAttaching the patch...
Comment #4
Taras_ commentedsubscribe.
Comment #5
catchWe could put a hook implementation in the new memcache.module, and check to see if we're using memache for sessions - if so clear the cache?
Comment #6
afox commentedThis apparently is still an issue, because at least my site has this problem. I'm using user_save to update data in the data column. This updates the users table, but memcache never updates the global $user -variable. I'm using the latest stable module (6.x-1.10). I also have secure pages module installed and running, but there's no change whether it's on or off. I'm even tried using an extra "cache_clear_all" after I do a user_save, but to no avail.
Anyone have ideas on how to proceed or debug better?
I'm setting this to 'major' for now.
Comment #7
gnindl commentedI noticed this as well as our site. The user object cached with memcache doesn't seem to be updated, e. g. changed roles, permissions etc. are not reflected. I ported the patch from commetn #3 and implemented a hook in memcache.module. In order to get it working you have to enable the memcache module.
Comment #8
timtrinidad commentedThe fix outlined in #7 (and #3) appears to have been committed to the module on September 2010 and is in the current version of the module (6.x-10):
http://drupalcode.org/project/memcache.git/commitdiff/2db1f6762359af8c30...
If you're still experiencing this issue, it may be caused by something else.
Comment #9
damienmckennaDrupal 6 has not been supported for a long time.