The simple-session package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Warnings:

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]

Properties

Versions0.6.0, 0.7.0, 0.8.0, 0.8.0.1, 0.8.0.1, 0.8.1.0, 0.9.0.0, 0.10.0.0, 0.10.1.0, 0.10.1.1
Change logNone available
Dependenciesbase (<6), base64-bytestring, blaze-builder, byteable, bytestring, containers, cookie, cryptohash, http-types, simple (>=0.8.0 && <0.9), transformers, wai (>=2.0) [details]
LicenseLGPL-3
AuthorAmit Aryeh Levy
Maintaineramit@amitlevy.com
CategoryWeb
Home pagehttp://simple.cx
Bug trackerhttp://github.com/alevy/simple/issues
Source repositoryhead: git clone http://github.com/alevy/simple.git
UploadedMon Apr 14 00:40:21 UTC 2014 by AmitLevy

Modules

Downloads

Maintainers' corner

For package maintainers and hackage trustees