Skip Navigation

[Resolved] Help me to understand the toolset_maps_location cookie

This support ticket is created 2 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by Matthew 2 years, 1 month ago.

Author
Posts
#2505869
Screenshot 2022-11-28 215937.jpg

I have a section on my homepage that displays near by gas stations if the browser shares its location.
This seems to be setting the toolset_maps_location cookie which is causing the following 2 issues:

#1) Since the cookie lasts for the browser session if you are driving around the distances to nearby stations don't update unless the browser is totally closed and re-opened.

#2) I'm trying to use Cloudflare APO and it looks like it won't cache any page that uses a cookie. So if any visitor at any time in their session hits the home page, no other visits to any pages will be cached through APO.

I can't seem to find any documentation for this cookie, can someone point me to something that would explain what this cookie is being used for, and if there is any way to either remove the cookie or have this data store somewhere else?

Thanks so much!

#2505973

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Your understanding of the cookie is basically correcy, when the user location is required Maps will try to get it from the browser geolocation API and then store the result in the toolset_maps_location cookie. And the cookie will persist for the duration of the session. If the location is needed again and the cookie is missing, the location will again be requested from the geolocation API and then the cookie set.

There isn't really any way to intervene in how this works, except you can of course add your own JS to remove the cookie if needed. (To actually delete a cookie rather than just empty its value you would set its expiration time to zero, see the notes in hidden link.)

From your description of the two issues, it sounds like you would want some code to delete the cookie at certain intervals (e.g. every minute?), and some code to delete the cookie when the user navigates away from the page.

#2506291

Hi Nigel,
Thanks for clarifying!

I've actually been able to find a way to tell Cloudflare APO to still cache pages even when that particular cookie is set. Which resolves that part of the issue.

You're right about the other part as well, I'll just have to add some JS to modify the behaviour somehow, to prevent this from being cached for the entire session.
Thanks again!