Minifycode 2021-10-03 Viewed 3.2K times ASP.Net Core MVC

In this article, you will learn what is Session.abandon in asp.net core

In this article, how to use Session.abandon in asp.net core, there are two methods of interest. One is the Remove method which allows you to delete individual values from the session collection by key:-

For logout

public IActionResult LogOut()
        {
            HttpContext.Session.Clear();
            return RedirectToAction("Index", "Home");
        }

 

Context.Session.Remove("Name");

session.abandon in asp.net core: There are two other methods of interest. One is the Remove method which allows you to delete individual values from the session collection by key:
minify code