IIS And the basic authentication? Section closure


members of the community.

It turns out that I implemented an ASP.NET MVC application in the organization, I am using the basic authentication of IIS, I was investigating how I could close the section after a user authenticated but it is not possible .. the only way is to close the browser . The question is this:

If I close the tab of the application obviously will not lose the beginning of section, to open another tab will not ask me again the credentials is there any way that when I open another tab again ask for my credentials? since you can not create a Logout botton.

asked by AlejandroMst 27.11.2018 в 15:16

1 answer


What you can do is create a Log Out button in the main Layout and call an action where you delete the Session that you have reached in the access form. It would be something like this:

public ActionResult SignOut()
        { Session["login"] = null;
            return RedirectToAction("Index");

I hope it helps you;)

answered by 27.11.2018 в 17:01