Crates.io | dce-session |
lib.rs | dce-session |
version | 1.0.0 |
source | src |
created_at | 2024-06-28 08:04:13.226455 |
updated_at | 2024-06-28 08:04:13.226455 |
description | A session lib with user binding and renewable. |
homepage | https://drunkce.com |
repository | https://github.com/idrunk/dce-rust |
max_upload_size | |
id | 1286525 |
size | 64,886 |
dce-session
is a generic session manager (not exclusive to dce
, can be integrated into any project), including basic session management, user session management, connection session management, self-regenerating session management, and the implementation of all the aforementioned session managers in the Redis version.
Basic session management traits mainly include some basic session storage interfaces, such as get
, set
, del
, etc. Some of them with the silent_
prefix indicate that this interface has silent and non-silent versions, where the non-silent version automatically touch
(update session expiration time). There are also some interfaces starting with cloned_
, used to handle some old sessions when regenerating sessions.
User session management traits encapsulate basic user session management interfaces, such as user
, login
, logout
, etc.
Connection session management traits are used to handle session management for long connections.
The self-regenerating session manager is used to automatically regenerate a new ID for a session after a certain period of time, even if the session has not expired, to enhance session security.
Abbreviation Notes
RedisSession
is a built-in implementation of session management in dce-session
, implementing the aforementioned "basic", "user", and "connection" session features, and can select which features to enable through control feature switches.
For complete usage examples, please refer to the files prefixed with
session_
in the src directory. For more comprehensive documentation, click here.