When 2 users access the system at the same time, it somehow confuses users, not just the name, but their permissions too ...
I'm assigning the session after logging in to ActionFilter
public class UsuarioAttribute : ActionFilterAttribute
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
int idUsuario= new UsuarioNegocio().GetIdByExternalId(decodedToken.ExternalUserId.ToInt32());//Id vem de um token
Usuario usuario = new UsuarioNegocio().GetById(idUsuario);
filterContext.HttpContext.Session["Usuario"] = usuario;
}
And in BaseController I have the following method to retrieve the session:
public Usuario GetCurrentUser()
{
return (Usuario)HttpContext.Session["Usuario"];
}
Has anyone had this problem with session?