Expose a property on session to know whether the session was uninitialized
Open
question
- Dominant language
- JavaScript
- Stars
- 6.4k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Hey,
maybe I can't read the doc properly :) but I couldn't find how to know if the session is new. A easy-ish way is to check `connect.sid` and compare with `req.sessionId` but this is not very elegant, especially that the information is easy to get from inside the session middleware.
Another possibility is to set a specific boolean in the session and check this.
My use case is that I want to prevent from accessing a resource if there is no active session yet.
Contributor guide
Assessment
This issue has not been assessed yet.