Make banner cookies expire after one year
This avoids having lots of cookies stick around forever and we shouldn't ever have a banner up for that long.
This commit is contained in:
parent
5ad17c1068
commit
fb9afd32db
1 changed files with 4 additions and 1 deletions
|
@ -174,12 +174,15 @@ $(document).ready(function () {
|
||||||
$.cookie('_osm_welcome', 'hide', { expires: expiry });
|
$.cookie('_osm_welcome', 'hide', { expires: expiry });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var bannerExpiry = new Date();
|
||||||
|
expiry.setYear(expiry.getFullYear() + 1);
|
||||||
|
|
||||||
$('#banner .close-wrap').on('click', function(e) {
|
$('#banner .close-wrap').on('click', function(e) {
|
||||||
var cookieId = e.target.id;
|
var cookieId = e.target.id;
|
||||||
$('#banner').hide();
|
$('#banner').hide();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (cookieId) {
|
if (cookieId) {
|
||||||
$.cookie(cookieId, 'hide', { expires: expiry });
|
$.cookie(cookieId, 'hide', { expires: bannerExpiry });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue