Stateful session handling functions. Uses a memory-store by default, but can use a custom store by supplying a :session-store option to server/start. All keys are stored as strings.
Stateful session handling functions. Uses a memory-store by default, but can use a custom store by supplying a :session-store option to server/start. All keys are stored as strings.
(clear!)
Remove all data from the session and start over cleanly.
Remove all data from the session and start over cleanly.
(flash-get)
Retrieve the flash stored value. This will remove the flash from the session.
Retrieve the flash stored value. This will remove the flash from the session.
(flash-put! v)
Store a value with a lifetime of one retrieval (on the first flash-get, it is removed). This is often used for passing small messages to pages after a redirect.
Store a value with a lifetime of one retrieval (on the first flash-get, it is removed). This is often used for passing small messages to pages after a redirect.
(get k)
(get k default)
Get the key's value from the session, returns nil if it doesn't exist.
Get the key's value from the session, returns nil if it doesn't exist.
(put! k v)
Associates the key with the given value in the session
Associates the key with the given value in the session
(remove! k)
Remove a key from the session
Remove a key from the session
(swap! f & args)
Replace the current session's value with the result of executing f with the current value and args.
Replace the current session's value with the result of executing f with the current value and args.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close