Skip to content
Browse files

Configurable session name

  • Loading branch information...
1 parent 8d0f429 commit 4ac413e419de667219c52643ad238f3195d786da @snoyberg snoyberg committed Apr 7, 2012
Showing with 4 additions and 7 deletions.
  1. +0 −4 yesod-core/Yesod/Internal.hs
  2. +4 −3 yesod-core/Yesod/Internal/Core.hs
View
4 yesod-core/Yesod/Internal.hs
@@ -24,7 +24,6 @@ module Yesod.Internal
, runUniqueList
, toUnique
-- * Names
- , sessionName
, tokenKey
) where
@@ -98,9 +97,6 @@ newtype Body url = Body (HtmlUrl url)
tokenKey :: IsString a => a
tokenKey = "_TOKEN"
-sessionName :: IsString a => a
-sessionName = "_SESSION"
-
type CssBuilderUrl a = (a -> [(Text, Text)] -> Text) -> Builder
data GWData a = GWData
View
7 yesod-core/Yesod/Internal/Core.hs
@@ -699,17 +699,18 @@ clientSessionBackend :: Yesod master
-> Int -- ^ Inactive session valitity in minutes
-> SessionBackend master
clientSessionBackend key timeout = SessionBackend
- { sbLoadSession = loadClientSession key timeout
+ { sbLoadSession = loadClientSession key timeout "_SESSION"
}
loadClientSession :: Yesod master
=> CS.Key
- -> Int
+ -> Int -- ^ timeout
+ -> S8.ByteString -- ^ session name
-> master
-> W.Request
-> UTCTime
-> IO (BackendSession, SaveSession)
-loadClientSession key timeout master req now = return (sess, save)
+loadClientSession key timeout sessionName master req now = return (sess, save)
where
sess = fromMaybe [] $ do
raw <- lookup "Cookie" $ W.requestHeaders req

0 comments on commit 4ac413e

Please sign in to comment.
Something went wrong with that request. Please try again.