# Linking users across browsers

**URL:** <https://forum.mautic.org/t/linking-users-across-browsers/29625>\
**Category:** Product Support\
**Created:** [October 11, 2023, 6:44pm UTC](https://forum.mautic.org/t/linking-users-across-browsers/29625 "2023-10-11T18:44:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/abs/32/10663_2.png) [@abs](https://forum.mautic.org/u/abs)\
**Post date:** [October 11, 2023, 6:44pm UTC](https://forum.mautic.org/t/linking-users-across-browsers/29625/1 "2023-10-11T18:44:50Z")

</div>

**Your software**  
My Mautic version is: v4.4.10  
My PHP version is: PHP Version 7.4.3-4ubuntu2.19  
My Database type and version is: mariadb v10.3.38

**Your problem**  
We’re looking to integrate Mautic into an existing web-app which supports user login. The plan is to:

- Use a common base domain
- Check for an mtc\_id cookie in the web-app after login
- If the cookie is present, record the Mautic user id and push name/email via API to Mautic
- If the cookie is not present, and no Mautic user id is known, include mtc.js and pick up the cookie on next request
- Whenever a user adjusts their subscription data in the web-app, also push that into Mautic

That should ensure every web-app user gets a Mautic contact, and Mautic has the latest data

But we’re wondering if we can do more, specifically if a user who already has a Mautic id tracked in the web-app logs into the web-app on a new browser - can we include some tag in the page to populate the new web browser session with the same Mautic user id - effectively using the web-app to bridge the gap between the two browsers and link them to the same Mautic user?

Thanks

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [October 12, 2023, 9:32am UTC](https://forum.mautic.org/t/linking-users-across-browsers/29625/2 "2023-10-12T09:32:04Z")

</div>

Hi,  
Before this can be answered, it would be interesting to know - is there a chance that 2 people use the same browser?

J

---

<div class="post-metadata">

**Author:** ![abs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/abs/32/10663_2.png) [@abs](https://forum.mautic.org/u/abs)\
**Post date:** [October 12, 2023, 3:32pm UTC](https://forum.mautic.org/t/linking-users-across-browsers/29625/3 "2023-10-12T15:32:54Z")

</div>

There is always a chance that a browser could have multiple users within the scope of a persistent cookie (whether within a given session or across multiple sessions for the same OS user)

(For convenience I’m just going to use “different browser sessions” to mean any case where a persistent cookie is not available, whether two different browsers on the the same machine, across different devices, or even after a cookie clear)

If two different browser sessions both login to a web-app as the same web-app user, there is a high likelyhood that they are the same user (particularly if the web-app involves managing user specific data and offers free and paid accounts - so sharing accounts does not make sense). The correlation should be of about the same quality as having two different browser sessions click on the same tracking link in an email .

Orthogonally from this question of linking a user across browser sessions, we have the interesting question of how to handle a session with a Mautic id linked to one web-app user then logs into the web-app with a different web-app user - do we do something to replace the Mautic cookie with one linked to the new web-app user (I assume so - this is likely akin to someone clicking on a tracking link on an email when there is a different Mautic user id already in the cookie)

I’m hoping that covers the question 🙂

David
