Skip to content

Ring session store which is based on shared map #98

Closed
@xfeep

Description

@xfeep

When worker_processes > 1 in nginx.conf, we can not use the default in-memory session store
because there're more than one JVM instances and requests from the same session perphaps
will be handled by different JVM instances. Alough cookie store is no prolem for this case,
if we provide shared map based session store there will be more chioces. e.g.

(def my-session-store
  ;; use cookie store 
  ;(ring.middleware.session.cookie/cookie-store {:key "a 16-byte secret"})

  ;; use nginx shared map store
  (nginx.clojure.session/shared-map-store "mySessionStore"))

in nginx.conf

shared_map mySessionStore tinymap?space=1m&entries=256;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions