diff --git a/modules/user/user.module b/modules/user/user.module index c484c68..87d67cb 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -370,6 +370,7 @@ function user_save($account, $array = array(), $category = 'account') { if (sizeof($authmaps) > 0) { user_set_authmaps($user, $authmaps); } + cache_clear_all($account->uid, 'users'); return $user; } diff --git a/sites/default/modules/memcache/memcache-session.inc b/sites/default/modules/memcache/memcache-session.inc index d302a28..13b98e2 100644 --- a/sites/default/modules/memcache/memcache-session.inc +++ b/sites/default/modules/memcache/memcache-session.inc @@ -89,6 +89,10 @@ function sess_write($key, $value) { $session->session = $value; $session->timestamp = time(); + // Be sure that we have the latest user object. If user_save() has been + // called, we need to refresh the object from the database. + $user = sess_user_load($session); + // If this is an authenticated user, or there is something to save in the // session, or this is an anonymous user who currently has nothing in the // session but did have something in session storage, write it to memcache.