# Cookies issue

**URL:** <https://forum.mautic.org/t/cookies-issue/17394>\
**Category:** Development\
**Tags:** mautic-3, development, discussion, community\
**Created:** [December 14, 2020, 4:10am UTC](https://forum.mautic.org/t/cookies-issue/17394 "2020-12-14T04:10:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitsah](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/amitsah/32/580_2.png) [@amitsah](https://forum.mautic.org/u/amitsah)\
**Post date:** [December 14, 2020, 4:10am UTC](https://forum.mautic.org/t/cookies-issue/17394/1 "2020-12-14T04:10:56Z")

</div>

Hello Everyone,  
Can any one guide me how i can delete cookies after logout. please help is there any function in mautic.  
issue i am facing:- because cookies are not deleting so whenever i am signup with other account it will over-ridding the previous data And i think it is happing because cookies are not deleting.  
Can someone help me on this.  
Regards

---

<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:** [December 14, 2020, 2:34pm UTC](https://forum.mautic.org/t/cookies-issue/17394/2 "2020-12-14T14:34:55Z")

</div>

Hi, please use the RemoveCookiesForSite plugin for chrome. It works well.  
You can also do testing in incognito mode, or use another browser.  
Good luck!

---

<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:** [December 15, 2020, 11:43am UTC](https://forum.mautic.org/t/cookies-issue/17394/4 "2020-12-15T11:43:23Z")

</div>

Do you mean - You are deploying Mautic for a client?  
The problem is, if you remove the admin cookie, you will start tracking of the website for admins. That can lead to even more confusion. All statistics will be messed up.  
Joey

---

<div class="post-metadata">

**Author:** ![amitsah](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/amitsah/32/580_2.png) [@amitsah](https://forum.mautic.org/u/amitsah)\
**Post date:** [December 15, 2020, 12:00pm UTC](https://forum.mautic.org/t/cookies-issue/17394/5 "2020-12-15T12:00:26Z")

</div>

Hello @joeyk  
What is mean is :-

1. Client is not going to clear cookies every time.
2. They will not open mautic in incognito mode or They will not install any plugins  
its a lengthy process.  
So What i am asking is that is there any other way to do it from dev side. so that client will not bother about this things.

#discussion please help it is very urgent  
Regards

---

<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:** [December 15, 2020, 12:12pm UTC](https://forum.mautic.org/t/cookies-issue/17394/6 "2020-12-15T12:12:33Z")

</div>

Hi,

I understand your point.  
To my knowledge there is no such modification at this point.  
Maybe you can create this by modifying the logout sequence.

Disabled tracking for admin is a very good feature.

Joey

---

<div class="post-metadata">

**Author:** ![amitsah](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/amitsah/32/580_2.png) [@amitsah](https://forum.mautic.org/u/amitsah)\
**Post date:** [December 15, 2020, 12:30pm UTC](https://forum.mautic.org/t/cookies-issue/17394/7 "2020-12-15T12:30:09Z")

</div>

Hello @joeyk,  
Thank you for quick reply.  
I want to mentioned one more thing that I have installed mautic for my webapp. So what happen is if same client is signup twice the contact getting merged. it is not creating new contact.  
And Customer who is coming on my website they will not install plugins.

Regards,

---

<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:** [December 15, 2020, 12:33pm UTC](https://forum.mautic.org/t/cookies-issue/17394/8 "2020-12-15T12:33:04Z")

</div>

Okay, I think you confused me with the words client and contact.  
What do you mean by ‘Signup’? Filling out a form?  
If filling out a form is a signup for you than Mautic has a solution: you need to use Kiosk mode for the form you are using:

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/7/7aa8deeb88dba0a8e618d416c363b9e9909590a6.png)

---

<div class="post-metadata">

**Author:** ![amitsah](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/amitsah/32/580_2.png) [@amitsah](https://forum.mautic.org/u/amitsah)\
**Post date:** [December 15, 2020, 12:41pm UTC](https://forum.mautic.org/t/cookies-issue/17394/9 "2020-12-15T12:41:25Z")

</div>

Hello @joeyk,  
I am explaining what is happing. I have a web app there. I have put mautic script to generate contacts.  
So if i am signing up there Eg:- first\_name, last\_name, email Than what happing is Contact is creating on my dashboard but suppose i have logged out my-self from than webapp and next time when i am doing signup. than new contact is not creating it is getting merged in previous one. So is there any solution for this. So that every time same user will signup I want that should come as new contact created.  
And its not a form. It just a other website where i have kept mautic script to generate contacts.

Note:- Thank you for you response  
please help me on this.

Regards

---

<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:** [December 15, 2020, 12:46pm UTC](https://forum.mautic.org/t/cookies-issue/17394/10 "2020-12-15T12:46:37Z")

</div>

Hi,  
If YOU are signing up with your browser, YOU will be tracked and all your signups will be merged as one. But that is how it supposed to be 🙂

If a real contact signs up from their OWN browser and OWN instance, they will be tracked and not merged with you.

If you want to turn off the cookie tracking for that specific form, than use kiosk mode. In this case no other contacts will be merged.

---

<div class="post-metadata">

**Author:** ![amitsah](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/amitsah/32/580_2.png) [@amitsah](https://forum.mautic.org/u/amitsah)\
**Post date:** [December 15, 2020, 1:02pm UTC](https://forum.mautic.org/t/cookies-issue/17394/11 "2020-12-15T13:02:32Z")

</div>

Hello @joeyk,  
If YOU are signing up with your browser, YOU will be tracked and all your signups will be merged as one. But that is how it supposed to be.  
This I got.  
But what happen is even though i am filling different data. Eg:- suppose my first signup data is Amit, kumar, [amit123@gmail.com](mailto:amit123@gmail.com) And after logout if i am signing up again with different data like:- Sumit, kumar, [sumitkr23@gmail.com](mailto:sumitkr23@gmail.com). Than in this case it should not be merged right, But What happen is in this case also both data is getting merged.

Thank you for your previous reply.  
please help me on this.  
Regards,

---

<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:** [December 15, 2020, 1:18pm UTC](https://forum.mautic.org/t/cookies-issue/17394/12 "2020-12-15T13:18:37Z")

</div>

> And after logout if i am signing up again

Logout from where?  
Aren’t you filling out a mautic form, that is placed on a page?

---

<div class="post-metadata">

**Author:** ![amitsah](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/amitsah/32/580_2.png) [@amitsah](https://forum.mautic.org/u/amitsah)\
**Post date:** [December 15, 2020, 1:27pm UTC](https://forum.mautic.org/t/cookies-issue/17394/13 "2020-12-15T13:27:34Z")

</div>

Hello @joeyk,  
logout from my webapp. Yes I am not filling mautic form. i am filling a form on a website which is given by that website. But what i have done is. I have kept similer mt() function with more fields.  
mt(‘send’, ‘pageview’, {email: ‘my@email.com’, firstname: ‘John’});

Regards,

---

<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:** [December 15, 2020, 1:33pm UTC](https://forum.mautic.org/t/cookies-issue/17394/14 "2020-12-15T13:33:25Z")

</div>

Okay, so when you pass the pageview, than you pass the name and email.  
That is EXACTLY what happens:  
You tell Mautic: Hello Mautic, with this email and name and ip there is a new contact, or if there is one, please merge.  
Only record the Pageview if the contact is browsing the page who the name and email belongs to.

I’m not sure, that I can help you, but you should check the tracking settings in the Settings page (Cogwheel on the right). There you can tweak Mautic tracking and make sure you are merging what you want to merge.

For me it looks like the changes in the tracking cookie have this sideeffect you mentioned.  
I’d suggest to use API for a tracking where pageview tracking is not needed.

---

<div class="post-metadata">

**Author:** ![namratasaun](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/namratasaun/32/2801_2.png) [@namratasaun](https://forum.mautic.org/u/namratasaun)\
**Post date:** [December 16, 2020, 6:12pm UTC](https://forum.mautic.org/t/cookies-issue/17394/15 "2020-12-16T18:12:58Z")

</div>

by api, you mean tracking pixel or just the api?  
because i am facing the same issue and it merges the contacts  
[Link to a similar question](https://forum.mautic.org/t/tracking-site-which-one-can-log-out-from/4765)  
what I. want is that I have a normal website where i login and logout and it’s made in javascript.  
so what i do is everytime someone signs up, i use this function call

> mt(“send”, “pageview”, {…properties})

and it saves a cookie by the name mtc\_id and mautic\_device\_id.  
so, suppose i want to logout and sign in from some other id, it will pick the previous cookie and update the previous contact.  
so, i want to delete the cookie from my javascript website, but i am unable to do that because that cookie is set by my server say “panel.bumbl.it”  
so, is there any functionn that removes that cookie? which come from my server.

---

<div class="post-metadata">

**Author:** ![rivael](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rivael/32/422_2.png) [@rivael](https://forum.mautic.org/u/rivael)\
**Post date:** [December 20, 2020, 8:44pm UTC](https://forum.mautic.org/t/cookies-issue/17394/16 "2020-12-20T20:44:05Z")

</div>

Hello,

You can delete cookies in your browser.  
For firefox, follow this:

> **[Clear cookies and site data in Firefox | Firefox Help](https://support.mozilla.org/en-US/kb/clear-cookies-and-site-data-firefox#w_clear-cookies-for-the-current-website)**

---

<div class="post-metadata">

**Author:** ![namratasaun](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/namratasaun/32/2801_2.png) [@namratasaun](https://forum.mautic.org/u/namratasaun)\
**Post date:** [December 21, 2020, 12:37pm UTC](https://forum.mautic.org/t/cookies-issue/17394/17 "2020-12-21T12:37:15Z")

</div>

please reply @joeyk .  
i am stuck at a problem

---

<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:** [December 22, 2020, 5:13pm UTC](https://forum.mautic.org/t/cookies-issue/17394/18 "2020-12-22T17:13:33Z")

</div>

Hi, Sorry xmas is busy 🙂  
I’m not sure what you are trying to achieve. Mautic is tracking your contacts by placing cookie on their computer. Not on your computer.  
If you don’t want to track the form submission locations, you need to turn on Kiosk-Mode at the forms.  
Does that help?  
Joey

---

<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:** [December 22, 2020, 5:18pm UTC](https://forum.mautic.org/t/cookies-issue/17394/19 "2020-12-22T17:18:45Z")

</div>

> [@namratasaun](#):
>
> panel.bumbl.it

BTW, I noticed, that bumbl.it is a Mautic Provider. I think they can answer your question better, as they know their own environment.

---

<div class="post-metadata">

**Author:** ![namratasaun](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/namratasaun/32/2801_2.png) [@namratasaun](https://forum.mautic.org/u/namratasaun)\
**Post date:** [December 23, 2020, 9:12pm UTC](https://forum.mautic.org/t/cookies-issue/17394/20 "2020-12-23T21:12:16Z")

</div>

its ok and merry Christmas  
thanks a lot for your reply @joeyk  
i am using javascript script for tracking.  
Now suppose I want to track another user on the same browser.  
what i am currently doing is sending params with the script like email.  
so now suppose a user comes on my website and logs in, I start tracking their page activity using the script. and that page activity is linked to the email of the user.  
now suppose that user logs out and another user signs in.  
now when the script is called, with email, it updates the previous email merging the 2 contacts.  
I don’t want that.  
I want that when a user logs out, all the cookies gets deleted.  
so that when new user logs in with new email and the script is run with new email, it makes a new contact instead of merging with the older one (with same cookie)

---

<div class="post-metadata">

**Author:** ![vicampuzano](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/vicampuzano/32/2820_2.png) [@vicampuzano](https://forum.mautic.org/u/vicampuzano)\
**Post date:** [January 13, 2021, 7:03am UTC](https://forum.mautic.org/t/cookies-issue/17394/21 "2021-01-13T07:03:39Z")

</div>

Hi @namratasaun

Did you solve it? I think I found a solution but it required editing a Mautic PHP file.

1. You have to have Mautic hosted in a subdomain of your application domain. (Ex. [mautic.myapp.com](http://mautic.myapp.com)).

2. You have to edit the file app/bundles/LeadBundle/Tracker/Service/ContactTrackingService/ContactTrackingService.php and search for setCookie() lines. For each line, change the setCookie( call to add a domain parameter. setcookie(name,value,expires,null,".myapp.com"). That elevates the Mautic cookies to the parent domain and lets them accessible both to your Mautic instance as the app instance.

3. Now you can use javascript in your app to clean the mautic cookies when the user logs out. The cookies you have to delete are: mtc\_id, mtc\_sid, mautic\_device\_id, mautic\_session\_id and a cookie named as the value of mtc\_sid.

I have started testing this solution now in a production environment so I can’t ensure that is a correct and valid solution. But I think it will be.

I hope this helps you.

Remember you are editing a core PHP file at your own risk… 😬😬😬

[Next page](https://forum.mautic.org/t/cookies-issue/17394.md?page=2)
