I am trying to persist some data that I intend on using in the application in my HttpContext.User. However, when I go to another page/controller and I recheck HttpContext.User, its empty again. Is there a way to set this as persistent? I am not using any form of identity as my application relies on jwt
public IActionResult Index()
{
var claims = new[]
{
new Claim("name", "Test"),
};
var identity = new ClaimsIdentity(claims, "basic");
HttpContext.User = new ClaimsPrincipal(identity);
return View();
}