MongoDB-backed Ring SessionStore
_idMongoDB-backed Ring SessionStore - Session keys are generated with 256-bit CSPRNG randomness (java.security.SecureRandom) and encoded as URL-safe Base64 (43 characters, no padding). - The database stores a SHA-256 hash of the session key as the document `_id`
(make-store adapter & {:keys [read-only?]})Create Ring SessionStore backed by MongoDB.
adapter – an implementation of MongoAdapter.
read-only? – when true, write-session and delete-session are no-ops. Defaults to false
Create Ring SessionStore backed by MongoDB. `adapter` – an implementation of MongoAdapter. `read-only?` – when true, write-session and delete-session are no-ops. Defaults to false
MongoDB operations adapter
MongoDB operations adapter
(-get-session this id fields)Return a single document map matching the given id, projecting fields. Returns
nil if no document is found. Implementations must dissoc :_id from the MongoDB
document so that the return value matches the SessionResult schema.
Return a single document map matching the given `id`, projecting `fields`. Returns nil if no document is found. Implementations must dissoc `:_id` from the MongoDB document so that the return value matches the `SessionResult` schema.
(-insert-session! this id session)Execute a MongoDB insert with id as the document :_id and session as the other
document data
Execute a MongoDB insert with `id` as the document :_id and `session` as the other document data
(-remove-session! this id)Remove the document with the given id.
Remove the document with the given `id`.
(-update-session! this id session)Execute a MongoDB update with query and $set the session to the document.
Does NOT insert if document does not already exist.
Execute a MongoDB update with `query` and $set the `session` to the document. Does NOT insert if document does not already exist.
(session-id->db-id session-key)Derives the database document _id from the session key by computing its SHA-256 hash
Derives the database document `_id` from the session key by computing its SHA-256 hash
Schema for a session document read from the database.
Schema for a session document read from the database.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |