Good afternoon,
I have an aspx page that retrieves the value of the LOGON_USER variable. Using Chrome, the user is returned correctly on all machines, except for a single where the value is "" (empty).
If we clear the cache and immediately access the page, the correct value is returned. However, if we close the browser, opening it again to get to the page will cause the problem to happen again.
Does anyone have a suggestion as to why this occurs, and only on this particular machine?
In IE it works perfectly.
Thanks!
protected string NomeUsuarioCorrente(bool removerDominio = true)
{
string nomeUsuario = Request.ServerVariables["LOGON_USER"];
if (string.IsNullOrWhiteSpace(nomeUsuario))
return nomeUsuario;
if (nomeUsuario.StartsWith("0#.w|"))
nomeUsuario = nomeUsuario.Replace("0#.w|", string.Empty);
if (removerDominio)
nomeUsuario = nomeUsuario.Split('\')[1];
return nomeUsuario;
}