DEV Community

Discussion on: Authenticating Remix cookie sessions with Django cookie sessions

Collapse
 
jgb profile image
Jean Gérard Bousiquot

Nice! I'm wondering: if your app was an SPA working with the session data from the API, but since it's no more, is it possible to return a JWT token from the GraphQL API instead and store that in the remix session and send it back on subsequent requests?

Collapse
 
2ezpz2plzme profile image
Steven Liao

Yes. In your loader, you need to return the Set-Cookie header with the JWT token response though to the browser. Then every fetch from your browser will include that JWT token in the cookie header.

Collapse
 
jgb profile image
Jean Gérard Bousiquot

Hey Thank you! I actually did exactly that.