Skip to main content
Notice removed Needs detailed answers by Mark Cassidy
Notice added Needs detailed answers by Mark Cassidy
adding format around code snippet
Source Link
Gatogordo
  • 20.3k
  • 2
  • 39
  • 100

Try to clear the cache by using below code before creating user.

if (Sitecore.Context.ClientData != null)
{
var ClientDataValues = Sitecore.Context.ClientData.GetValueNames();
        if (ClientDataValues != null && ClientDataValues.Any())
        {
         var KeyName = "SC_USR_" + userName;
                var clientDataValue = Sitecore.Context.ClientData.GetValue(KeyName);
                if (clientDataValue != null)
                {
                 Sitecore.Context.ClientData.RemoveValue(KeyName);
                }
         }
}
if (Sitecore.Context.ClientData != null)
{
    var ClientDataValues = Sitecore.Context.ClientData.GetValueNames();
    if (ClientDataValues != null && ClientDataValues.Any())
    {
        var KeyName = "SC_USR_" + userName;
        var clientDataValue = Sitecore.Context.ClientData.GetValue(KeyName);
        if (clientDataValue != null)
        {
            Sitecore.Context.ClientData.RemoveValue(KeyName);
        }
    }
}

Give it a try and let me know.

Try to clear the cache by using below code before creating user.

if (Sitecore.Context.ClientData != null)
{
var ClientDataValues = Sitecore.Context.ClientData.GetValueNames();
        if (ClientDataValues != null && ClientDataValues.Any())
        {
         var KeyName = "SC_USR_" + userName;
                var clientDataValue = Sitecore.Context.ClientData.GetValue(KeyName);
                if (clientDataValue != null)
                {
                 Sitecore.Context.ClientData.RemoveValue(KeyName);
                }
         }
}

Give it a try and let me know.

Try to clear the cache by using below code before creating user.

if (Sitecore.Context.ClientData != null)
{
    var ClientDataValues = Sitecore.Context.ClientData.GetValueNames();
    if (ClientDataValues != null && ClientDataValues.Any())
    {
        var KeyName = "SC_USR_" + userName;
        var clientDataValue = Sitecore.Context.ClientData.GetValue(KeyName);
        if (clientDataValue != null)
        {
            Sitecore.Context.ClientData.RemoveValue(KeyName);
        }
    }
}

Give it a try and let me know.

Try to clear the cache by using below code before creating user.

if (Sitecore.Context.ClientData != null) { var ClientDataValues = Sitecore.Context.ClientData.GetValueNames(); if (ClientDataValues != null && ClientDataValues.Any()) { var KeyName = "SC_USR_" + userName; var clientDataValue = Sitecore.Context.ClientData.GetValue(KeyName); if (clientDataValue != null) { Sitecore.Context.ClientData.RemoveValue(KeyName); } } }

if (Sitecore.Context.ClientData != null)
{
var ClientDataValues = Sitecore.Context.ClientData.GetValueNames();
        if (ClientDataValues != null && ClientDataValues.Any())
        {
         var KeyName = "SC_USR_" + userName;
                var clientDataValue = Sitecore.Context.ClientData.GetValue(KeyName);
                if (clientDataValue != null)
                {
                 Sitecore.Context.ClientData.RemoveValue(KeyName);
                }
         }
}

Give it a try and let me know.

Try to clear the cache by using below code before creating user.

if (Sitecore.Context.ClientData != null) { var ClientDataValues = Sitecore.Context.ClientData.GetValueNames(); if (ClientDataValues != null && ClientDataValues.Any()) { var KeyName = "SC_USR_" + userName; var clientDataValue = Sitecore.Context.ClientData.GetValue(KeyName); if (clientDataValue != null) { Sitecore.Context.ClientData.RemoveValue(KeyName); } } }

Give it a try and let me know.

Try to clear the cache by using below code before creating user.

if (Sitecore.Context.ClientData != null)
{
var ClientDataValues = Sitecore.Context.ClientData.GetValueNames();
        if (ClientDataValues != null && ClientDataValues.Any())
        {
         var KeyName = "SC_USR_" + userName;
                var clientDataValue = Sitecore.Context.ClientData.GetValue(KeyName);
                if (clientDataValue != null)
                {
                 Sitecore.Context.ClientData.RemoveValue(KeyName);
                }
         }
}

Give it a try and let me know.

Source Link

Try to clear the cache by using below code before creating user.

if (Sitecore.Context.ClientData != null) { var ClientDataValues = Sitecore.Context.ClientData.GetValueNames(); if (ClientDataValues != null && ClientDataValues.Any()) { var KeyName = "SC_USR_" + userName; var clientDataValue = Sitecore.Context.ClientData.GetValue(KeyName); if (clientDataValue != null) { Sitecore.Context.ClientData.RemoveValue(KeyName); } } }

Give it a try and let me know.