aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2015-03-18 23:53:35 +0000
committerSean Whitton <spwhitton@spwhitton.name>2015-03-18 23:53:35 +0000
commit740abe29157f9afbfc1b83cf29945960dfe4fd6b (patch)
treea8eaa02991be144abfa82c50329f409f52897e4d
parentaf365f6c6eb27f8e3680afca52aa70550e992f6f (diff)
downloadsariulclocks-740abe29157f9afbfc1b83cf29945960dfe4fd6b.tar.gz
fix: cookie paths
-rw-r--r--assets/js/main.js3
-rw-r--r--src/Types/Session.hs7
2 files changed, 6 insertions, 4 deletions
diff --git a/assets/js/main.js b/assets/js/main.js
index 5ab3902..f4d5af2 100644
--- a/assets/js/main.js
+++ b/assets/js/main.js
@@ -46,7 +46,8 @@ function createCookie(name,value,days) {
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
- document.cookie = name+"="+value+expires+"; path=/";
+ // TODO: make this not absolute
+ document.cookie = name+"="+value+expires+"; path=/sariul/cgi-bin";
}
function readCookie(name) {
diff --git a/src/Types/Session.hs b/src/Types/Session.hs
index 5d037a4..210cd28 100644
--- a/src/Types/Session.hs
+++ b/src/Types/Session.hs
@@ -26,7 +26,7 @@ makeClassCookie now session =
Nothing -> "Nothing"
, cookieExpires = Just $ endOfSchoolDay now
, cookieDomain = Nothing
- , cookiePath = Nothing
+ , cookiePath = Just "/sariul/cgi-bin"
, cookieSecure = False}
makeClockCookie :: ClockTime -> Session -> Cookie
@@ -38,7 +38,7 @@ makeClockCookie now session =
CountUpClock -> "1"
, cookieExpires = Just $ endOfSchoolDay now
, cookieDomain = Nothing
- , cookiePath = Nothing
+ , cookiePath = Just "/sariul/cgi-bin"
, cookieSecure = False}
makeSsCookie :: ClockTime -> Session -> Cookie
@@ -50,7 +50,8 @@ makeSsCookie now session =
Just c -> show $ numberOfSs c
, cookieExpires = Just $ endOfSchoolDay now
, cookieDomain = Nothing
- , cookiePath = Nothing
+-- make the cookie path not absolute
+ , cookiePath = Just "/sariul/cgi-bin"
, cookieSecure = False}
endOfSchoolDay :: ClockTime -> CalendarTime