Cookies are not removed on the server
Description
@nuxtjs/apollo uses universal-cookie this module can read cookies but afaik it doen't modify the res. So it can't remove the cookie.
res.setHeader('Set-Cookie', ['token=deleted; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT']);
This means onLogout and onLogin have issues when they are beeing called on the server.
Code
- https://github.com/nuxt-community/apollo-module/blob/master/lib/templates/plugin.js#L135
- https://github.com/nuxt-community/apollo-module/blob/master/lib/templates/plugin.js#L122
@kieusonlam what do you think?
This issue as been imported as question since it does not respect apollo-module issue template. Only bug reports and feature requests stays open to reduce maintainers workload. If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically. Your question is available at https://cmty.app/nuxt/apollo-module/issues/c247.
@HaNdTriX sorry for super slow response. I'm afraid so, universal-cookie doesn't modify the res on server side, then we have to manual handle where apolloHeplers function should be running. But I think it's not hard to manage that, asyncData created or middleware on Nuxt, they're running on both server sided and client side.
I used to use another package call cookie-universal but it's have some problem can't be solve. https://github.com/nuxt-community/apollo-module/issues/243