fastify / fastify-secure-session

Create a secure stateless cookie session for Fastify
MIT License
201 stars 45 forks source link

Update cookie expiration without updating data #197

Closed Momy93 closed 1 year ago

Momy93 commented 1 year ago

Prerequisites

🚀 Feature Proposal

A touch() method (like in @fastify/session) to extend to cookie expiration date, without changing the session data. This could be done by setting changed=true.

Motivation

It's useful in scenarios where the session is extended evey time the client calls some endpoints.

Example

Whenever we want to extend the session, we would do:

request.session.touch();

jsumners commented 1 year ago

Would you like to send a Pull Request to address this issue? Remember to add unit tests.