Unable to get session cookies to work
See original GitHub issueI am trying to save some session data inside of a mutation. This is how I set the middleware and how I pass the session to the context.
const server = new GraphQLServer({
context: (req: ContextParameters) => {
return {
session: req.request.session
}
},
resolvers,
typeDefs
})
server.express.use(session({
cookie: {
httpOnly: false
},
saveUninitialized: true,
resave: false,
secret: 'keyboard cat'
}))
I successfully add values to the session object… but later on they are not present on the next requests (I am using the playground). Is it a problem with my middleware configuration or something more? In a plain Express JS app this configurations is working correctly.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Turn cookies on or off - Computer - Google Account Help
Cookies save browsing information to make your online experience easier. Discover how to turn cookies on or off while using the Google Chrome...
Read more >Can't seem to get session cookies working : r/webdev - Reddit
To check if browser is doing something for some reason you can open up (in chrome) dev tools, go to networking tab and...
Read more >How to Fix - Failed to set session cookie. Maybe you are using ...
Step 2: Clear the Cookies from your browser ... Now go to your browser settings and clear the cookies from it. Navigate to...
Read more >7 Keys to the Mystery of a Missing Cookie - Medium
Solution tip: Change the code where you are setting the cookie to set the Domain attribute accordingly. 6. Cookie Name is Prefixed with...
Read more >Unable to get session cookies to work · Issue #156 - GitHub
I am trying to save some session data inside of a mutation. This is how I set the middleware and how I pass...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, @schickling i’m forking auth example from examples with MongoDB modify (for DB and sessions via connect-mongo). after running it’s working perfect but when i’m upgrade graphql-yoga up to 1.16.2 v my server is stopped working as expected. signup/login - working fine isLogin (sessions) - don’t working (sessions in DB exists)
repo with my project can you check this out? pls
@giacomorebonato hey, bro. did you fix your problem? and how? i’m have same issues