We have our sign in and sign up process (OpenId endpoint) on a different website than our mobile app or website SaaS.
I'm uncertain on the best way to manage `reset`ing the distinctId to cater different user sign up on the same device.
Here are my thoughts so far.
- User goes to sign in page - identity server generates the random distinctId
- When user signs in - identity server aliases our userId
- Before it sends the user to the web app/mobile app - identity server identify random distinctId to alias
- Mobile/web app gets loaded with user profile - mixpanel sdk generates random distinctId AND we `identify` it with our userId
- **Now I hope we have the funnel mapped between the two apps (identity and SaaS)**
- User clicks log out - webapp/mobile `reset`s
- Webapp/mobile sends user back to identity server
- Identity Server sets a new cookie with a new distinctID to be loaded to the front-end (sign in page)
The bit I'm struggling the most is step 8.
I'm using the JS sdk on the identity front-end and using its data for back-end work.
But now i need to have the back-end data set on the front-end and hoping to overwrite the cookie that was generated by the SDK. How do I go about doing that.