CrossClj

0.1.0 docs

SourceDocs



RECENT

    arango-session

    Clojars

    Jan 4, 2015


    OWNER
    DeusDat Solutions
    Palatka, FL
    patrick.davenport@deusdatsolutions.com
    www.deusdatsolutions.com

    Readme

    Index of all namespaces


    « Project + dependencies

    Ring middleware to allow saving sessions into ArangoDB

    The README below is fetched from the published project artifact. Some relative links may be broken.

    arango-session

    A Ring compatible session manager built on ArangoDB.

    Usage

    First define your ArangoDB context. In this example the collection will be made if it doesn’t already exist.

    (def context {:conn {:type :simple
                          :url "http://arangodb:8529"
                          :uname "dev_user"
                          :password "secret"}
                   :async :stored
                   :db "example_db"
                   :connection-timeout 1000
                   :socket-timeout 2000
                   :accept-all-ssl? true
                   :in-collection "web-sessions"
                   :create-collection :yes})
    

    Second, define your web app as per usual using the session wrapper. The false parameter indicates that you don’t want to create new session entries with each session save.

    (def app
      (wrap-session handler {:store (arangodb-store context false)})
    

    Third, enjoy your new session store. Keep in mind the rules about ArangoDB. Don’t use :create-collection in a cluster setup; create the session collection before starting your system.