Repository navigation
x.vweb: add new sessions module - #20642
Merged
Merged
Conversation
xqliang
reviewed
Jan 24, 2024
spytheman
reviewed
Jan 28, 2024
spytheman
reviewed
Jan 28, 2024
spytheman
reviewed
Jan 28, 2024
spytheman
reviewed
Jan 28, 2024
spytheman
reviewed
Jan 28, 2024
spytheman
reviewed
Jan 28, 2024
spytheman
reviewed
Jan 28, 2024
spytheman
reviewed
Jan 28, 2024
spytheman
reviewed
Jan 28, 2024
spytheman
reviewed
Jan 28, 2024
spytheman
reviewed
Jan 28, 2024
spytheman
reviewed
Jan 28, 2024
spytheman
reviewed
Jan 28, 2024
merge changes from master
spytheman
marked this pull request as draft
February 3, 2024 11:17
Casper64
marked this pull request as ready for review
February 6, 2024 21:19
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add new sessions module for
x.vweb.The main goal of this session module is to provide a way of using sessions easily with vweb while also making it usable outside vweb.
Documentation is inside the README file.
Tests are also included.
Stores
The session store handles the saving, storing and retrieving of data. There are currently two implementations:
MemoryStore[T]stores session data in memory only using themapdatatype.DBStore[T]stores session data in a database by encoding the session data to JSON.It is possible to create your own implementation of a session store. You only need to follow the
Storeinterface. See "Custom Stores" in the README.Usage
This module provides a
Sessionsstruct which the user can embed in their vweb app. It makes the usage of sessions easier, for example session data is retrieved automatically when the provided middleware is used. The struct stores session id's in a cookie and you can use any session store.See the Usage section in the README file for more information and on how to use this module outside vweb, or without the
Sessionsstruct.