We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently migrating from express-session to this package is pain because of incompatible APIs.
It would be nice if session values should be read / written the same way they are in express-session;
fastify-session (current):
session.set('someValue', 123); session.get('someValue');
express-session (desired):
The text was updated successfully, but these errors were encountered:
If anyone else comes across this, a simple proxy does most of the job.
session: new Proxy(request.session, { get: (target: Session<UserSession>, prop: keyof UserSession) => { return target.get(prop); }, set: (target: Session<UserSession>, prop: keyof UserSession, value) => { target.set(prop, value); return true; }, }),
Sorry, something went wrong.
I also come to this issue. But I have no idea where to put this code? add it to onRequest hook?
thanks.
No branches or pull requests
Currently migrating from express-session to this package is pain because of incompatible APIs.
It would be nice if session values should be read / written the same way they are in express-session;
fastify-session (current):
express-session (desired):
The text was updated successfully, but these errors were encountered: