CustomerContext.Current not updated on logout

Vote:
 

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

Carsten

Episerver Commerce 10.1

#174256
Edited, Jan 23, 2017 14:43
Vote:
 

Hi,

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.

Regards,

/Q

#174258
Jan 23, 2017 15:50
Vote:
 

OK - thanks.

#174319
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.