clearSession
This commit is contained in:
parent
ba4cd002e1
commit
74a826fbb4
@ -76,6 +76,7 @@ module Yesod.Handler
|
||||
, setSession
|
||||
, setSessionBS
|
||||
, deleteSession
|
||||
, clearSession
|
||||
-- ** Ultimate destination
|
||||
, setUltDest
|
||||
, setUltDestCurrent
|
||||
@ -700,6 +701,12 @@ setSessionBS k = modify . modSession . Map.insert k
|
||||
deleteSession :: Text -> GHandler sub master ()
|
||||
deleteSession = modify . modSession . Map.delete
|
||||
|
||||
-- | Clear all session variables.
|
||||
--
|
||||
-- Since: 1.0.1
|
||||
clearSession :: GHandler sub master ()
|
||||
clearSession = modify $ \x -> x { ghsSession = Map.empty }
|
||||
|
||||
modSession :: (SessionMap -> SessionMap) -> GHState -> GHState
|
||||
modSession f x = x { ghsSession = f $ ghsSession x }
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user