I'm looking for a process to handle multiple users logging into the same device. If we call IdentifyAs() on authentication, the next time this is called on the same browser, it will merge the contacts. What is a graceful way to handle ending the current analytics session and starting a new one? I've considered clearing the SC_ANALYTICS_GLOBAL_COOKIE on logout but this isn't ideal because the next request on the device will be a new contact, even if that person isn't actually a different person.
It should work this way out of the box if you call IdentifyAs and the current contact is known one: https://doc.sitecore.com/xp/en/developers/102/sitecore-experience-platform/identifying-contacts.html
Could you please let me know if it works differently for you?