-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
How can we manage session in the postgraphile app? #296
Comments
You don't need it; it's only there in case you don't want to use the redis session provider (or provide your own).
You can do it like you normally do in a normal express js app using any session library. You can replace the session store with whatever you want: starter/@app/server/src/middleware/installSession.ts Lines 30 to 56 in a69cf6b
[semi-automated message] Thanks for your question; hopefully we're well on the way to helping you solve your issue. This doesn't currently seem to be a bug in the library so I'm going to close the issue, but please feel free to keep requesting help below and if it does turn out to be a bug we can definitely re-open it 👍 You can also ask for help in the #help-and-support channel in our Discord chat. |
Summary
Hi, I'm new to the Postgraphile and I've just started looking at this starter kit to know about how the session is managed in this postgraphile app. I saw there are 2 tables being used for a session management in this starter kit, 1.
connect_pg_simple_sessions
2.sessions
. And I've seen that thesessions
table gets updated in every valid graphql request made to the database which keeps track of user that made request and his/her last active time. Also it has been used to track user login while login request is made throughlogin
function in the database where on successful login a new record is inserted into this table. But theconnect_pg_simple_sessions
table has just been used or initialized at the time of middleware setup on the server. So my question is if we're using thesessions
table to track user logins and every graphql request made by user then what is the use ofconnect_pg_simple_sessions
table within the app? How can we track user's session after their login like we normally do in normal express js app using any session library (i.e. like this conect pg simple for instance)? How can we send session inside a cookie to the user after user logs in in the postgraphile app?Additional context
Trying to understand the session management logic flow in the postgraphile with the help of this starter kit so no additional context but some above questions.
The text was updated successfully, but these errors were encountered: