Get Cookie Issue on Mobile

Hi guys,

We’re having an issue with the {{dc:cookie:get name=“isVet”}} condition on the front-end.

On desktop, it seems to work as expected, but the behaviour seems to be a bit inconsistent on mobile (debugging on iOS Safari). We can see that the cookie is there on dev tools, but for some reason this condition doesn’t kick in:

We have some Page JS that checks document.cookies, which is working as expected:
window.addEventListener(‘DOMContentLoaded’, () => {
// console.log(document.cookie);
if (!document.cookie.split(’;’).some(c => c.trim().startsWith(‘isVet=’))) {
if (window.location.hash !== ‘#access’) {
window.location.hash = ‘access’;
}
}
});

Weirdly, sometimes it worked when we added that console.log() statement above, but other times it didn’t, and we’re not sure why. Are there any known issues with dc:cookie:get, or any ideas of what could be causing this?

Thanks

Just digging into this a bit more - it seems that users who are not logged into WordPress aren’t seeing this issue, but logged out users are. Also, for more context, the cookie is set on a Cornerstone Form.

We’re wondering if maybe this is a bug?

Hello @RubberDuckers,

We would be happy to double check your site if we can log in. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Sure thing