aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2015-03-23 06:07:27 +0000
committerSean Whitton <spwhitton@spwhitton.name>2015-03-23 06:07:27 +0000
commit38107bbadb1739e17afe9886ee6a7d31368c1be2 (patch)
treea978a917926c50833e358704b0d1fdd98df6934a /src
parent3d024944e8e572a48377d37f3a0a9bfa52020cf2 (diff)
downloadsariulclocks-38107bbadb1739e17afe9886ee6a7d31368c1be2.tar.gz
dynamic cookie path (so works with devel site too)
Diffstat (limited to 'src')
-rw-r--r--src/Types/Session.hs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Types/Session.hs b/src/Types/Session.hs
index 2f17de9..356d1f1 100644
--- a/src/Types/Session.hs
+++ b/src/Types/Session.hs
@@ -21,8 +21,8 @@ freshSession = Session { currentClass = Nothing
-- Cookie where it uses the reader monad to get the CalendarTime and
-- maybe the session from the state monad
-makeClassCookie :: ClockTime -> Session -> Cookie
-makeClassCookie now session =
+makeClassCookie :: ClockTime -> String -> Session -> Cookie
+makeClassCookie now path session =
Cookie { cookieName = "class_cookie"
, cookieValue =
case currentClass session of
@@ -30,11 +30,11 @@ makeClassCookie now session =
Nothing -> "Nothing"
, cookieExpires = Just $ endOfSchoolDay now
, cookieDomain = Nothing
- , cookiePath = Just "/sariul/cgi-bin"
+ , cookiePath = Just path
, cookieSecure = False}
-makeClockCookie :: ClockTime -> Session -> Cookie
-makeClockCookie now session =
+makeClockCookie :: ClockTime -> String -> Session -> Cookie
+makeClockCookie now path session =
Cookie { cookieName = "clock_cookie"
, cookieValue =
case currentClock session of
@@ -42,11 +42,11 @@ makeClockCookie now session =
CountUpClock -> "1"
, cookieExpires = Just $ endOfSchoolDay now
, cookieDomain = Nothing
- , cookiePath = Just "/sariul/cgi-bin"
+ , cookiePath = Just path
, cookieSecure = False}
-makeSsCookie :: ClockTime -> Session -> Cookie
-makeSsCookie now session =
+makeSsCookie :: ClockTime -> String -> Session -> Cookie
+makeSsCookie now path session =
Cookie { cookieName = "ss_cookie"
, cookieValue =
case currentClass session of
@@ -55,7 +55,7 @@ makeSsCookie now session =
, cookieExpires = Just $ endOfSchoolDay now
, cookieDomain = Nothing
-- make the cookie path not absolute
- , cookiePath = Just "/sariul/cgi-bin"
+ , cookiePath = Just path
, cookieSecure = False}
endOfSchoolDay :: ClockTime -> CalendarTime