simple-session: Cookie-based session management for the Simple web framework

[ lgpl, library, web ] [ Propose Tags ]

Adds cookie-based session management to simple Controllers. 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]
Versions [RSS] [faq] 0.6.0, 0.7.0, 0.8.0,,,,,,, 1.0.0
Change log
Dependencies base (<6), base64-bytestring, blaze-builder, byteable, bytestring, containers, cookie, cryptohash, http-types, simple (>=0.10), transformers, wai (>=3.0), wai-extra (>=3.0) [details]
License LGPL-3.0-only
Author Amit Aryeh Levy
Category Web
Home page
Bug tracker
Source repo head: git clone
Uploaded by AmitLevy at 2020-04-13T13:07:51Z
Distributions NixOS:1.0.0, Stackage:1.0.0
Downloads 6282 total (49 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2020-04-13 [all 3 reports]


  • Web
    • Simple
      • Web.Simple.Session


Maintainer's Corner

For package maintainers and hackage trustees