A Riak implementation for Ring Sessions
Clojure
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
example
src/ring/middleware/session
test/ring/middleware/session
.gitignore
README.md
project.clj

README.md

ring-session-riak

This permits you to store your ring session in riak.

Usage

In your project.clj [ring-session-riak "0.0.1"]

Wrap your routes:

(-> routes
    (wrap-session {:store (ring.middleware.session.riak/riak-store)}))

The riak-store fn provides a few options to give it:

:host - the host to connect to. String. Defaults to localhost
:port - the port to connect to. Number. Defaults to 8087
:bucket - the bucket to save sessions into. Defaults to "sessions"

Examples

In examples/functional you have an example of using pure ring sessions with riak. To switch over to use "normal" memory sessions from ring just remove the {:store (riak-store)} option to the wrap-session middleware.

In examples/stateful you have an example of using the stateful sessions from sandbar. Same routine there to switch over to memory backed stateful sessions, just remove the {:store (riak-store)} option to wrap-stateful-session.

TODO

This should support conflict resolution as well as setting the R and W values.

How are sessions expired? In ring? For plugin stores?

Copyright (C) 2011 Parham Michael Ossareh

Distributed under the Eclipse Public License, the same as Clojure.