From: Tom Hughes Date: Wed, 11 Dec 2013 00:19:49 +0000 (+0000) Subject: Issue all _osm_location cookies against the root path X-Git-Tag: live~4493 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/19c77c3d24e31d1e5d44616ca25c02ee97ed27bd Issue all _osm_location cookies against the root path To ensure that any old cookies issued against other paths are removed we make sure to do a removeCookie call first without a path being specified so that any cookie for the current page is removed before we add a new one against the root. Fixes #652 --- diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index d07c9797d..a300cc280 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -150,7 +150,8 @@ $(document).ready(function () { map.getLayersCode(), map._object); - $.cookie("_osm_location", cookieContent(map), { expires: expiry }); + $.removeCookie("_osm_location"); + $.cookie("_osm_location", cookieContent(map), { expires: expiry, path: "/" }); }); if ($.cookie('_osm_welcome') == 'hide') {