úÎCà?ï"      !None+23468=BHKM!' provides the primary interface to get  sessionData, put  sessionData or expire  sessionData.lThis is a class so you can use newtype deriving to make the functions available in your custom server monad.X provides an environment in which we can access and update the client-side session state0The inner monad needs to provide an instance of ": so that the cookie value can be read and set. According  must appear outside  ServerPartT not inside it.   is like #, except it records if $ was ever called Wrapper around the sessionData which tracks it state so we can avoid decoding or encoding/sending the cookie when not required4Configuration for the session cookie for passing to  or !.-Name of the cookie to hold your session data.Lifetime of that cookie.$Encryption key, usually from one of ,  and . cookie domain cookie path*Only use a session over secure transports.UOnly use session over HTTP (to prevent it from being stolen via cross-site scripting)7Your session type must have an instance for this class.NAn empty session, i.e. what you get when there is no existing session stored. Create a ' using defaults for everything except C. You can use record update syntax to override individual fields. ûmain = do key <- getDefaultKey let sessConf = (mkSessionConf key) { sessionCookieLife = oneWeek } simpleHTTP nullConf $ withClientSessionT sessConf handlers where oneWeek = MaxAge $ 60 * 60 * 24 * 7 handlers = msum [...] is currently defined as: ÿ/mkSessionConf :: Key -> SessionConf mkSessionConf key = SessionConf { sessionCookieName = "Happstack.ClientSession" , sessionCookieLife = Session , sessionKey = key , sessionDomain = "" , sessionPath = "/" , sessionSecure = False , sessionHttpOnly = True } see also: , %run  $ and get the result, plus the final SessionStatus sessionData'Transform the inner monad. (similar to &)The  forall s.4 is to prevent you from modifying the session state.1In theory we want this function to have the type: NmapSessionStateT :: (m a -> n b) -> SessionStateT s m a -> SessionStateT s n b9But that can not be done, so this is the next best thing.' similar to &6. This version allows modification of the session datarun the ) monad and get the result plus the final SessionStatus sessionDataThis function does notz automatically update the cookie if the session has been modified. It is up to you to do that. You probably want to use ! instead. see also: !, <transform the inner monad, but leave the session data alone.(transform the inner monad) Fetch the * Fetch the  and apply a function to it+6Fetch the current value of the state within the monad.,$ s$ sets the state within the monad to s.- create a new session by calling .!decode the encypted cookie string/Kget the session cookie and decrypt it. If no cookie is found, return a new .0get the  sessionData1Put a new value in the session.2/Expire the session, i.e. the cookie holding it. lift a computation from the   monadHThe primary purpose of this function is to make it possible to use the 3 functions such as 4 and set* to get and set the current session data."That makes it possible to use the 3 based functions provided by , e.g.: &do c <- liftSessionStateT $ count += 1!2Wrapper around your handlers that use the session.RThis function automatically takes care of expiring or updating the cookie if the  or  modifySession is called.iIf no changes are made to the session, then the cookie will not be resent (because there is no need to).Cget the current  sessionDataset the  sessionData'expire the session (deletes the cookie) 56 %'()*+,-./012 !789:;<=>?@ABCDEFGHIJKL"  !"   !  / 56  %'()*+,-./012 !789:;<=>?@ABCDEFGHIJKLM      !"#$%&'()*+,-./)*0123456789:;<,-=,->?@ABCDEFGHIJKLMNOPQRSTUVhappstack-clientsession-7.3.0Happstack.Server.ClientSessionDataLensclientsession-0.9.1.1Web.ClientSession randomKeygetKey getDefaultKeyKeyMonadClientSession getSession putSession expireSessionClientSessionTunClientSessionT SessionStateT SessionStatusExpiredModifiedNoChangeUnread SessionConfsessionCookieNamesessionCookieLife sessionKey sessionDomain sessionPath sessionSecuresessionHttpOnly ClientSession emptySession mkSessionConfmapSessionStateTrunClientSessionTmapClientSessionTliftSessionStateTwithClientSessionThappstack-server-7.4.4Happstack.Server.Monads Happstacktransformers-0.4.3.0Control.Monad.Trans.State.LazyStateT mtl-2.2.1Control.Monad.State.ClassputrunSessionStateT mapStateTmapSessionStateT_mapClientSessionT_askSessionConfasksSessionConfgetSessionStatusputSessionStatus newSessiondecodegetValue getSessionCST putSessionCSTexpireSessionCST MonadStategetunSessionStateT#$fMonadClientSessionsessionDataRWST&$fMonadClientSessionsessionDataWriterT%$fMonadClientSessionsessionDataStateT&$fMonadClientSessionsessionDataReaderT%$fMonadClientSessionsessionDataErrorT$$fMonadClientSessionsessionDataContT-$fMonadClientSessionsessionDataClientSessionT$fMonadRWSrwsClientSessionT$fMonadStatesClientSessionT$fMonadWriterwClientSessionT$fMonadReaderrClientSessionT!$fMonadBaseControlbClientSessionT!$fMonadTransControlClientSessionT$fMonadTransClientSessionT$fMonoidClientSessionT$fHappstackClientSessionT $fMonadBaseControlbSessionStateT $fMonadTransControlSessionStateT$$fMonadStatesessionDataSessionStateT$fMonoidSessionStateT$fHappstackSessionStateT $fSafeCopyKey