summaryrefslogtreecommitdiffstats
path: root/tools/droiddoc/templates-sdk
diff options
context:
space:
mode:
authorsmain@google.com <smain@google.com>2014-11-03 10:47:12 -0800
committerScott Main <smain@google.com>2014-11-03 19:40:48 +0000
commit80e38f4872941cbf0114ad80e260993f1eafc14c (patch)
treee7e2d24b1f396a62085dcefda644e57cfc3dbf1a /tools/droiddoc/templates-sdk
parent9b7f8f20ac58133af551bc89e5f065a4e0f77103 (diff)
downloadbuild-80e38f4872941cbf0114ad80e260993f1eafc14c.zip
build-80e38f4872941cbf0114ad80e260993f1eafc14c.tar.gz
build-80e38f4872941cbf0114ad80e260993f1eafc14c.tar.bz2
remove cookie expiration and add max-age of 2 years.
bug: 17781603 Change-Id: Idab3cae786fde4d0318ba03d3c7f5f678882b815 (cherry picked from commit f51f30d7f10a32e07a081b799d9ae601be08276c)
Diffstat (limited to 'tools/droiddoc/templates-sdk')
-rw-r--r--tools/droiddoc/templates-sdk/assets/js/docs.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js
index d3f815a..8daef7f 100644
--- a/tools/droiddoc/templates-sdk/assets/js/docs.js
+++ b/tools/droiddoc/templates-sdk/assets/js/docs.js
@@ -900,16 +900,14 @@ function readCookie(cookie) {
return 0;
}
-function writeCookie(cookie, val, section, expiration) {
+function writeCookie(cookie, val, section, age) {
if (val==undefined) return;
section = section == null ? "_" : "_"+section+"_";
- if (expiration == null) {
- var date = new Date();
- date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week
- expiration = date.toGMTString();
+ if (age == null) {
+ var age = 2*365*24*60*60; // set max-age to 2 years
}
var cookieValue = cookie_namespace + section + cookie + "=" + val
- + "; expires=" + expiration+"; path=/";
+ + "; max-age=" + age +"; path=/";
document.cookie = cookieValue;
}