Session cookie not being passed from server to client

I have a client and server on Railway - a graphql server and a Remix app. On localhost my code works fine - I can login normally with a session that is passed from my backend and then set on my client. However, this session is not being passed to my frontend. I had the same issue on Heroku (I just recently migrated code from it to Railway) and I thought it might be specific to Heroku due to it being on some public list https://devcenter.heroku.com/articles/cookies-and-herokuapp-com but seeing as how it's doing the exact same thing on Railway, doesn't seem to be the issue (Unless railway is as well). Attached you'll find code of the relevant stuff. Any help here would be super appreciated.
Cookies and the Public Suffix List | Heroku Dev Center
Applications in the herokuapp.com domain are unable to set cookies for *.herokuapp.com.
No description
No description
Solution:
Should app.set('trust proxy', true) work?
Jump to solution
7 Replies
Percy
Percy13mo ago
Project ID: a9371739-bf34-4550-8b92-f02d02e53cfd
quinnvaughn
quinnvaughnOP13mo ago
a9371739-bf34-4550-8b92-f02d02e53cfd
quinnvaughn
quinnvaughnOP13mo ago
set-cookie is not there on login
No description
Brody
Brody13mo ago
both on railway and on heroku your app sits behind a proxy, look into how you would set cookies behind a proxy
Solution
quinnvaughn
quinnvaughn13mo ago
Should app.set('trust proxy', true) work?
quinnvaughn
quinnvaughnOP13mo ago
(It's an express graphql server) It did, thanks.
Brody
Brody13mo ago
no problem!
Want results from more Discord servers?
Add your server