Munchkin cookie disappears if user refreshes the page after giving consent to cookies | Community
Skip to main content
New Participant
July 14, 2021
Solved

Munchkin cookie disappears if user refreshes the page after giving consent to cookies

  • July 14, 2021
  • 1 reply
  • 4346 views

Hello again!

 

We have created a landing page, where the munchkin cookie disappears when you refresh the page (after accepting all cookies):

<deleted-url-to-site>

 

Does anybody have an idea of what can be causing this issue?

 

The setup:

- Cookie-banner is set via GTM container.

- If user gives consent a trigger fires, that sets the Marketo Munchkin cookie.

 

Any help would be much appreciated!

 

Best,

ernie

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Your cookie consent code is explicitly deleting it on refresh. As you can see here, the variable o is empty, which is how you delete a cookie.

 

 

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
July 14, 2021

Your cookie consent code is explicitly deleting it on refresh. As you can see here, the variable o is empty, which is how you delete a cookie.

 

 

NestoJosaAuthor
New Participant
July 14, 2021

Hi @sanfordwhiteman!

 

Thanks for your prompt response!

 

Now, do you have any idea as to why this is happening?

 

When I check the console, there is also a warning, when you refresh the page, saying 'Cookie “_mkto_trk” has been rejected for invalid domain.'

 

I think that this is the reason as to why the cookie is being set with an empty string  - its being deleted because the domain is invalid for some reason. But I simply cannot figure out why. 

 

Thanks in advance!

SanfordWhiteman
New Participant
July 14, 2021

When I check the console, there is also a warning, when you refresh the page, saying 'Cookie “_mkto_trk” has been rejected for invalid domain.'

Your cookie consent code does have a “tree-walking” test where it tries to delete and reset the cookie at every possible parent level (not a very well-written test, I must say). You’d have to talk to the vendor to discover how you can ensure the cookie is preserved, rather than being deleted and never recreated.