]> git.openstreetmap.org Git - rails.git/commitdiff
Give location cookie a 10 year expiry.
authorTom Hughes <tom@compton.nu>
Mon, 1 Jun 2009 13:54:44 +0000 (13:54 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 1 Jun 2009 13:54:44 +0000 (13:54 +0000)
app/views/site/index.rhtml

index 53a4c9a07800aa27e44576fa278c46532942a4de..37004e25bdbf872c91259622b53c5c6036164f41 100644 (file)
@@ -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() {