Skip to content
This repository
Browse code

Configurable session name

  • Loading branch information...
commit 4ac413e419de667219c52643ad238f3195d786da 1 parent 8d0f429
Michael Snoyman snoyberg authored
4 yesod-core/Yesod/Internal.hs
@@ -24,7 +24,6 @@ module Yesod.Internal
24 24 , runUniqueList
25 25 , toUnique
26 26 -- * Names
27   - , sessionName
28 27 , tokenKey
29 28 ) where
30 29
@@ -98,9 +97,6 @@ newtype Body url = Body (HtmlUrl url)
98 97 tokenKey :: IsString a => a
99 98 tokenKey = "_TOKEN"
100 99
101   -sessionName :: IsString a => a
102   -sessionName = "_SESSION"
103   -
104 100 type CssBuilderUrl a = (a -> [(Text, Text)] -> Text) -> Builder
105 101
106 102 data GWData a = GWData
7 yesod-core/Yesod/Internal/Core.hs
@@ -699,17 +699,18 @@ clientSessionBackend :: Yesod master
699 699 -> Int -- ^ Inactive session valitity in minutes
700 700 -> SessionBackend master
701 701 clientSessionBackend key timeout = SessionBackend
702   - { sbLoadSession = loadClientSession key timeout
  702 + { sbLoadSession = loadClientSession key timeout "_SESSION"
703 703 }
704 704
705 705 loadClientSession :: Yesod master
706 706 => CS.Key
707   - -> Int
  707 + -> Int -- ^ timeout
  708 + -> S8.ByteString -- ^ session name
708 709 -> master
709 710 -> W.Request
710 711 -> UTCTime
711 712 -> IO (BackendSession, SaveSession)
712   -loadClientSession key timeout master req now = return (sess, save)
  713 +loadClientSession key timeout sessionName master req now = return (sess, save)
713 714 where
714 715 sess = fromMaybe [] $ do
715 716 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.