From 48d9fc4452d17f003a8cf136cc7252c4ba414fde Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Mon, 23 Jul 2012 02:37:28 -0400 Subject: [PATCH] Don't hardcode the path - use window.location.pathname. --- static/js/copyvios.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/copyvios.js b/static/js/copyvios.js index a4257b8..7a77aae 100644 --- a/static/js/copyvios.js +++ b/static/js/copyvios.js @@ -16,6 +16,7 @@ function get_cookie(name) { } function set_cookie(name, value, days) { + var path = window.location.pathname.split("/", 2)[1]; if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); @@ -24,7 +25,7 @@ function set_cookie(name, value, days) { else { var expires = ""; } - document.cookie = name + "=" + value + expires + "; path=/~earwig"; + document.cookie = name + "=" + value + expires + "; path=/" + path; } function delete_cookie(name) {