[X] I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
Add support for different "instances" of the session plugin, with different cookie names and cookie options (different path/expiration date). This could be accomplished by allowing to specify the decorated field name (request.session by default) in plugin options.
Please keep in mind this will require changing the way types work, as the SessionData is currently set for the entire @fastify/secure-session module
Motivation
I need to keep a separate session for short-term (data expiring after closing tab) and long-term storage (user login token)
Prerequisites
🚀 Feature Proposal
Add support for different "instances" of the session plugin, with different cookie names and cookie options (different path/expiration date). This could be accomplished by allowing to specify the decorated field name (
request.session
by default) in plugin options.Please keep in mind this will require changing the way types work, as the
SessionData
is currently set for the entire@fastify/secure-session
moduleMotivation
I need to keep a separate session for short-term (data expiring after closing tab) and long-term storage (user login token)
Example