2

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;
    }
}
Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265
Ungaro
  • 522
  • 6
  • 15
  • Are you sure you are using MVC6? – DavidG Jul 28 '14 at 10:24
  • I fail to see your code... – walther Jul 28 '14 at 10:43
  • Edited to include the requested code and expected behavior. – Ungaro Jul 28 '14 at 14:03
  • have you fixed this issue? – SDK Feb 01 '16 at 13:09
  • Yes, I have. I cannot post the code because it is deemed too long.The gist AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie); System.Runtime.Caching.MemoryCache.Default.Remove((string)Session["UserName"]); ViewBag.AuthCount = System.Runtime.Caching.MemoryCache.Default.Where(kv => kv.Value.ToString() == "Auth").Count(); – Ungaro Feb 01 '16 at 17:33

0 Answers0