Try our conversational search powered by Generative AI!

CustomerContext.Current not updated on logout


Hey there.

Using Forms authentication.

When a customer logs in, the CustomerContext.Current is updated immediately (so we get the correct cart by providing CustomerContextFacade.CurrentContactId), but when he logs out, the CustomerContext.Current is not updated immediately so I still get the cart as if he was logged in...

We logout via FormsAuthentication.SignOut();

Best regards


Episerver Commerce 10.1

Edited, Jan 23, 2017 14:43


By CustomerContext.Current I suppose you meant CustomerContext.Current.CurrentContact?

That depends on the PrincipleInfo.CurrentPrincipal, which itself depends on HttpContext.Current.User, so to make the data refresh, you need to refresh the page after FormsAuthentication.SignOut(). A redirect to the home page is a common practice.



Jan 23, 2017 15:50

OK - thanks.

Jan 24, 2017 13:07
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.