From: Tom Hughes Date: Mon, 1 Jun 2009 13:54:44 +0000 (+0000) Subject: Give location cookie a 10 year expiry. X-Git-Tag: live~7331 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/f5fa16c24f4bdf4b5b60072e4651eaa55fc3d635?hp=0a334787f1a789817d52fc2503e3056cb9a7bfca Give location cookie a 10 year expiry. --- diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml index 53a4c9a07..37004e25b 100644 --- a/app/views/site/index.rhtml +++ b/app/views/site/index.rhtml @@ -170,10 +170,12 @@ end var zoom = map.getZoom(); var layers = getMapLayers(); var extents = getMapExtent(); + var expiry = new Date(); updatelinks(lonlat.lon, lonlat.lat, zoom, layers, extents.left, extents.bottom, extents.right, extents.top); - - document.cookie = "_osm_location=" + lonlat.lon + "|" + lonlat.lat + "|" + zoom + "|" + layers; + + expiry.setYear(expiry.getFullYear() + 10); + document.cookie = "_osm_location=" + lonlat.lon + "|" + lonlat.lat + "|" + zoom + "|" + layers + "; expires=" + expiry.toGMTString(); } function resizeContent() {