Category "forms-authentication"

Update authentication Cookie in ASP.net CORE 3

In ASP.net CORE 3 app, I use authentication cookie without Identity. Here is the code when a user log in. string securityStamp = Guid.NewGuid().ToString(); var

HttpContext.User NullReferenceException only on deployed server

I am using formsauthentication on my MVC project and when testing locally using the Visual Studio Development Server everything works as expected. Once deployed

HttpContext.User.Identity.IsAuthenticated throws System.NullReferenceException: Object reference not set to an instance of an object

My code is simple like : [HttpGet] public ActionResult Login () { if (User.Identity.IsAuthenticated) { return RedirectToAction("Index", "Home");