Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Riak implementation for Ring Sessions

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 example examples of riak-store being used February 22, 2011
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 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.

Something went wrong with that request. Please try again.