I am working with a strange credit card payment gateway where I send encrypted transaction info to the bank website. There the user enters the card info. I have set up two URLs with the bank (PaymentSuccess and PaymentFailure) where they return after payment processing. Payments and refunds, correct and incorrect all work as designed, except...
I am unable to log the user off after getting back from the bank: AuthenticationManager.SignOut()
silently fails, no exception, no error just keeps the current user signed in only in IE. The same code works great in Chrome, Firefox, Opera, Safari.
The code, which is supposed to log a logged on user out of the system but doesn't:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult LogOff()
{
//Response.Clear();
AuthenticationManager.SignOut();
Session["UserName"] = null;
return RedirectToAction("Login", "Account");
}
private IAuthenticationManager AuthenticationManager
{
get
{
return HttpContext.GetOwinContext().Authentication;
}
}