Title: User cannot authenticate after signup when object cache enabled
Last modified: August 20, 2016

---

# User cannot authenticate after signup when object cache enabled

 *  Resolved [tonny@debug.dk](https://wordpress.org/support/users/tonnydebugdk/)
 * (@tonnydebugdk)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/user-cannot-authenticate-after-signup-when-object-cache-enabled/)
 * Ive just upgraded to wordpress 3.5.1 and the new object-cache.php version 2.0.2
   that users some new switch to blog cache functionality.
 * We had this issue with the previous version of object cache, but i managed to
   solve it by delete the users keys when doing signup and activation of the blogs.
   This cleared the cached password from memcache, that for some reason is wrong.
 * I tried reimplement this, but it does not work. Ive put this code in my register
   page:
 * wp_cache_key_delete(“4e76434eea3c9d9cf9cb10bbf3f4a74b92:users:1”);
    wp_cache_delete(‘
   users’);
 * the hash is my KEY SALT
 * and again on the activation page i use this
 * wp_cache_key_delete(“4e76434eea3c9d9cf9cb10bbf3f4a74b92:users:”.$user_id);
    wp_cache_delete(‘
   users’);
 * This should clear the cached users and their password, so auth will happens against
   the password in the mysql database.
 * I added theese 2 functions to object-cache.php to handle they key deletion
 * #hack by tonny
 * function wp_cache_key_delete($key) {
    global $wp_object_cache;
 * return $wp_object_cache->key_delete($key);
    }
 * and this
 * function key_delete($key) {
 * $mc =& $this->get_mc($group);
 * $result = $mc->delete($key);
 * @ ++$this->stats[‘delete’];
    $this->group_ops[$group][] = “delete $id”;
 * if ( false !== $result )
    unset($this->cache[$key]);
 * return $result;
    }
 * Has any of you had similar issues with users not beging able to login when signing
   up / registering a blog ?
 * [http://wordpress.org/extend/plugins/memcached/](http://wordpress.org/extend/plugins/memcached/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [tonny@debug.dk](https://wordpress.org/support/users/tonnydebugdk/)
 * (@tonnydebugdk)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/user-cannot-authenticate-after-signup-when-object-cache-enabled/#post-3449798)
 * This is now solved The solution was this in the activation script:
 * $blog_real_id = $wpdb->get_var(“select blog_id from wp_bp_user_blogs where user_id
   = “.$user_id.” limit 1″);
 * wp_cache_key_delete(“1:users:”.$user_id);
    wp_cache_key_delete($blog_real_id.”:
   users:”.$user_id);
 * This clears the cached user info for blog id 1 and the signed up blog ud.

Viewing 1 replies (of 1 total)

The topic ‘User cannot authenticate after signup when object cache enabled’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/memcached.svg)
 * [Memcached Object Cache](https://wordpress.org/plugins/memcached/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/memcached/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/memcached/)
 * [Active Topics](https://wordpress.org/support/plugin/memcached/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/memcached/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/memcached/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [tonny@debug.dk](https://wordpress.org/support/users/tonnydebugdk/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/user-cannot-authenticate-after-signup-when-object-cache-enabled/#post-3449798)
 * Status: resolved