Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convenient way to dump session state to Redis database #17

Open
DamianDunajski opened this issue Apr 20, 2020 · 0 comments
Open

Convenient way to dump session state to Redis database #17

DamianDunajski opened this issue Apr 20, 2020 · 0 comments
Assignees

Comments

@DamianDunajski
Copy link
Contributor

DamianDunajski commented Apr 20, 2020

Community has raised need for having easier way to sync session state with storage.

Background

Currently session middleware is only responsible for reading data from store and initiating session in request scope. In turn it is not responsible for writing updated session back into session store. State persistence needs to be dona manually through manual use of SessionStore.

Options

Two potential options have been named:

  1. separate write middleware that detects session state change and performs state dump into session store

  2. extensions to existing middleware that utilises response hooks and performs state dump into session store just before response flow is about to end - based on how express session module works

Second one is preferred cause it offers all-in-one solution which does not require other application middlewares to be mindful of session writing middleware to not break the middleware invocation chain.

@DamianDunajski DamianDunajski changed the title Convenient way to dump session state to Redis database [DRAFT] Convenient way to dump session state to Redis database Apr 22, 2020
@DamianDunajski DamianDunajski self-assigned this Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant