I have a Home Controller with these actions:
public class HomeController : Controller
{
[Authorize]
public ActionResult Index()
{
return View();
}
public ActionResult Logoff()
{
HttpContext.Session.Remove("LogonTicket");
HttpContext.Session.Remove("PID");
return View("Index");
}
Now, when I logoff using the Logoff Action, I want the Authorize attribute of the Index to take effect but it doesn’t when I return the Index View in the Logoff Action.
How would I handle this?
I’m using a custom MembershipProvider and not sure how to put Logoff functionality in it.
Done in the AccountController Logoff Action. They are public “globals” in a base controller now, too.