-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(middleware/session): Update session middleware for v3 changes
- Loading branch information
Showing
1 changed file
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -314,9 +314,17 @@ Added support for specifying Key length when using `encryptcookie.GenerateKey(le | |
|
||
### Session | ||
|
||
:::caution | ||
DRAFT section | ||
::: | ||
The Session middleware has undergone key changes in v3 to improve functionality and flexibility. While v2 methods remain available for backward compatibility, we now recommend using the new middleware handler for session management. | ||
Check failure on line 317 in docs/whats_new.md GitHub Actions / markdownlintTrailing spaces
|
||
|
||
#### Key Updates: | ||
Check failure on line 319 in docs/whats_new.md GitHub Actions / markdownlintTrailing punctuation in heading
|
||
|
||
- **New Middleware Handler**: The `New` function now returns a middleware handler instead of a `*Store`. To access the session store, use the `Store` method on the middleware, or opt for `NewWithStore` for custom store integration. | ||
|
||
- **Manual Session Release**: Session instances are no longer automatically released after being saved. To ensure proper lifecycle management, you must manually call `sess.Release()`. | ||
|
||
- **Idle Timeout**: The `Expiration` field has been replaced with `IdleTimeout`, which strictly handles session inactivity. If you require a maximum session duration, you'll need to implement it within your own session data. | ||
|
||
For more details on these changes and migration instructions, check the [Session Middleware Migration Guide](./middleware/session.md#migration-guide). | ||
|
||
### Filesystem | ||
|
||
|