Mautic Community Forums

Cookie Domain

Any idea on what is the “Cookie Domain” for (under s/config/edit) ?



I’m trying to make my website (mautic.dev) read the cookie from Mautic (installed in mautic-mautic.dev), but since those sites are in different domains the cookies are not available in mautic.dev.



I was wondering if the above would solve my problem. But if I set it to any value ( I believe the proper value for my case would be “mautic.dev”) it looks like Mautic is not creating any cookies (and creating a lead for any page refresh/access).



Do you have any ideas on how could I solve this?

Any idea on what is the “Cookie Domain” for (under s/config/edit) ?

I’m trying to make my website (mautic.dev) read the cookie from Mautic (installed in mautic-mautic.dev), but since those sites are in different domains the cookies are not available in mautic.dev.

I was wondering if the above would solve my problem. But if I set it to any value ( I believe the proper value for my case would be “mautic.dev”) it looks like Mautic is not creating any cookies (and creating a lead for any page refresh/access).

Do you have any ideas on how could I solve this?

Is the release of Mautic 1.4 really just 2 days ago? https://github.com/mautic/mautic/releases

The alternative you proposed sounds good. Thx!

I know this is an old thread, but I don’t feel like francescjr’s question was answered, so for the benefit of others, I thought I’d put this here…

The cookie domain can be important when you want to be able to share cookies across multiple web properties that are all subdomains of each other. You generally want to leave this blank or set it to a parent domain of the domain you host Mautic at.

For example, you might have Mautic installed at go.mydomain.com, have a website at www.mydomain.com and have a customer site at portal.mydomain.com. If your cookie is set at go.mydomain.com, it will still allow you to track activity at www.mydomain.com and portal.mydomain.com (assuming you have put those domains in your valid domains under CORS settings), but if you want to be able to directly access the cookies to get the Mautic ID of the visitor, you’ll need to have the cookie domain set to the parent domain.

Google Analytics is using “.domain.com” with a “.” at the beginning, and I think that would be the best practice in setting cookie domain so that the cookie is accessible in all subdomains.

“Automatic cookie domain configuration sets the _ga cookie on the highest level domain it can. For example, if your website address is blog.example.co.uk, analytics.js will set the cookie domain to .example.co.uk. In addition, if analytics.js detects that you’re running a server locally (e.g. localhost) it automatically sets the cookieDomain to ‘none’.”

From:
https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id#automatic_cookie_domain_configuration

Could you please explain how to do that? Thanks!