Module resty.session.redis.common
Common Redis functions shared between Redis, Redis Cluster and Redis Sentinel implementations.
Functions
module.SET (storage, red, name, key, value, ttl, current_time[, old_key], stale_ttl[, metadata], remember) | Store session data. |
module.GET (storage, red, name, key) | Retrieve session data. |
module.UNLINK (storage, red, name, key, current_time[, metadata]) | Delete session data. |
module.READ_METADATA (storage, red, name, audience, subject, current_time) | Read session metadata. |
Functions
- module.SET (storage, red, name, key, value, ttl, current_time[, old_key], stale_ttl[, metadata], remember)
-
Store session data.
Parameters:
- storage table the storage
- red table the redis instance
- name string the cookie name
- key string session key
- value string session value
- ttl number session ttl
- current_time number current time
- old_key string old session id (optional)
- stale_ttl string stale ttl
- metadata table table of metadata (optional)
- remember table whether storing persistent session or not
Returns:
- true or nil ok
- string error message
- module.GET (storage, red, name, key)
-
Retrieve session data.
Parameters:
- storage table the storage
- red table the redis instance
- name string cookie name
- key string session key
Returns:
- module.UNLINK (storage, red, name, key, current_time[, metadata])
-
Delete session data.
Parameters:
- storage table the storage
- red table the redis instance
- name string cookie name
- key string session key
- current_time number current time
- metadata table session meta data (optional)
Returns:
- boolean or nil session data
- string error message
- module.READ_METADATA (storage, red, name, audience, subject, current_time)
-
Read session metadata.
Parameters:
- storage table the storage
- red table the redis instance
- name string cookie name
- audience string session key
- subject string session key
- current_time number current time
Returns: