Package Info

ghc-simple-session


Cookie-based session management for the Simple web framework


Development/Libraries/Haskell

Adds cookie-based session management to simple 'Controller's. To add to an application, declare the Controller setting's type an instance of 'HasSession', and wrap routes with 'withSession'. For example:

> data AppSettings = ... > > instance HasSession AppSettings where > ...

> controllerApp settings $ withSessions $ do > routeName "posts" $ ...

Then, in your controllers you can seemlessly get and set keys from the session:

> get "/profile" $ do > muserId <- sessionLookup "current_user_id" > case muserIf of > Nothing -> respond $ redirectTo "/login" > Just userId -> [handle request].


License: LGPL-3.0+
URL: https://hackage.haskell.org/package/simple-session

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.10.1.1-bp150.1.3 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • x86-64
  • ghc-simple-session
  • ghc-simple-session-devel