Don't add the user id until we actually set the cache.

From #6831.
Fixed.