When the user successfully login, i'm storing the username in tempdata so i can use it in my _Layout:
TempData["username"] = model.Email.Split('@')[0];
TempData.Keep("username");
on my _Layout:
<li class="nav-item">
<h5 style="color:white"> Welcome, @TempData["username"]</h5>
</li>
this actually works on the first load, but if I go to another page, the tempdata turns to null and no username is displaying. How can i keep the username on my _layout?