simple-session: Cookie-based session management for the Simple web framework
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]
Downloads
- simple-session-0.9.0.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0.6.0, 0.7.0, 0.8.0, 0.8.0.1, 0.8.1.0, 0.9.0.0, 0.10.0.0, 0.10.1.0, 0.10.1.1, 1.0.0, 2.0.0 |
|---|---|
| Dependencies | base (<6), base64-bytestring, blaze-builder, byteable, bytestring, containers, cookie, cryptohash, http-types, simple (>=0.9), transformers, wai (>=2.1) [details] |
| License | LGPL-3.0-only |
| Author | Amit Aryeh Levy |
| Maintainer | [email protected] |
| Category | Web |
| Home page | http://simple.cx |
| Bug tracker | http://github.com/alevy/simple/issues |
| Source repo | head: git clone http://github.com/alevy/simple.git |
| Uploaded | by AmitLevy at 2014-06-14T21:09:21Z |
| Distributions | LTSHaskell:2.0.0, NixOS:2.0.0 |
| Reverse Dependencies | 1 direct, 0 indirect [details] |
| Downloads | 7384 total (19 in the last 30 days) |
| Rating | 2.0 (votes: 1) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs not available [build log] All reported builds failed as of 2016-12-14 [all 7 reports] |