guest order reassigned to logged in user v13

Vote:
 

I have a weird issue.

chrome: I purchase an item  as a guest(anonymous)

firefox: logged in to see orders in episerver.  I see the order with anonymous info.

chrome: click login and login as a registered user

firefox: refresh orders page and see that last order gets assigned to the account I just logged in with on chrome

I'm not sure how I go about deleting whatever is in memory so that the last guest order doesn't get reassigned to the next logged in user.  I do have _orderRepository.Delete(cart.OrderLink) on finishing a checkout but it looks like I need to do something else to clear out the order session info.

  Any help would be appreciated. thank you

#251338
Mar 25, 2021 0:02
Vote:
 

Hi Peter,

The issue look like related to state management, so you can try SessionState(SessionStateBehavior.Disabled)] on action/controller level and the _orderRepository.Delete(cart.OrderLink) is the correct way to delete a cat.

#251340
Mar 25, 2021 7:47
Vote:
 

I assume you log in on Firefox with admin account?

The order will be assigned to the next user login (on same browse/session) as a default behavior of IProfileMigrator. If you want to disable that, you can implement your own MigrateOrders method, then register the class yourself.

#251342
Mar 25, 2021 8:31
Vote:
 

As Sunjay mentioned it looks like the issue is related to the session state. it seems the session not expired and you tried to log in on chrome. 

you can reduce session timeout or as Quan mentioned, implement your own IProfileMigrator

#251428
Mar 25, 2021 20:44
* 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.