-
Notifications
You must be signed in to change notification settings - Fork 49
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
A session is not being created when using connect-mongo and fastify/session in versions later than 10.7.0 #250
Comments
Thanks for reporting! Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that. |
If you have an https connection, check the following updates. https://github.com/fastify/session/releases/tag/v10.7.1
and see https://fastify.dev/docs/latest/Reference/Server/#trustproxy |
Thank you @rktyt for the link to the Fastify documentation you provided. The issue I was facing was resolved by enabling the Trust Proxy setting.
|
Ran into this as well when updating from 10.7.0 to 10.7.1. Was kind of surprised that this could happen because of a patch release. Think it wouldn't hurt to clarify this in the docs? |
If you would like to send a PR, it would be likely appreciated |
Will try my best to find the time. |
Prerequisites
Fastify version
4.27.0
Plugin version
10.7.1+
Node.js version
22.1.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
Windows 10
Description
Hi,
if I try to upgrade @fastify/session in my existing project, it won't store the session inside the MongoDB Atlas anymore. The latest version that works fine is 10.7.0. It correctly creates a session inside the store even for the user who isn't authenticated.
When I upgrade to 10.7.1 or the newer one 10.7.2, there are no empty sessions, written inside the store. Even the latest version 10.8.0 won't fix this issue.
To create the MongoDB Store for @fastify/session I'm using the package "connect-mongo@5.1.0", the latest version available.
Let me know if I'm missing something or if you need a sample project to simulate the issue. At this moment, the only thing that works is to revert the package to version 10.7.0.
Thanks in advance.
Link to code that reproduces the bug
No response
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: