Support deferring session cookie creation until data added #4719
Closed
jonahsnider
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I think you are using the wrong data point to find if the user is logged-in or not. Sessions and user auth are not the same thing. For example, a session will be/can be created for multiple other reasons. For example: If your app uses flash messages, or it writes something to the store, then also a session is persisted. A better way will be to let your frontend app hit once the backend endpoint and get the user info. And then you can check for |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
@adonisjs/session
middleware will set the session cookie for all incoming requests. I would like a way to alter this behavior to only set the session ID cookie once data is added with.put()
(ex. after signing in). This should be opt-in, to avoid breaking existing behavior.The use case for me is that my frontend can check if a user is authed by checking for presence of the
adonisjs-session
cookie, instead of making a request to the backend to check if the session is authed.Beta Was this translation helpful? Give feedback.
All reactions