Skip to content

Convenient way to dump session state to Redis database #17

@DamianDunajski

Description

@DamianDunajski

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions