UPDATE #2:
After Andrey Bobrov said, i try to clear cache by using this way:
namespace CustomLogin
{
public class EnforceEntireTree
{
public void Process(LoggedInArgs args)
{
User user = User.FromName(args.Username, true);
Assert.IsNotNull(user, "user");
string key = "/" + user.Name + "/UserOptions.View.ShowEntireTree";
user.Profile.Initialize(user.Name, true);
user.Profile[key] = "true";
user.Profile.Save();
RegistryCache registryCache = CacheManager.GetRegistryCache(Context.Site);
registryCache.Clear();
}
}
}
Still not working, Do I doing it wrong? If I clear all the cache from sitecore/admin/cache.aspx then the checkbox is checked just by using refresh (F5)
Thank You