Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

[BUG] No path for cookies can be provided in $cookies.set #1309

Closed
fsavina opened this issue Jan 22, 2021 · 0 comments · Fixed by #1350
Closed

[BUG] No path for cookies can be provided in $cookies.set #1309

fsavina opened this issue Jan 22, 2021 · 0 comments · Fixed by #1350
Assignees
Labels
bug Something isn't working

Comments

@fsavina
Copy link

fsavina commented Jan 22, 2021

We're experiencing some severe problems related to the fact that there's no path provided to the $cookies.set function.
https://github.com/vuestorefront/shopware-pwa/blob/master/packages/nuxt-module/plugins/api-client.js#L34

For example, if a user arrives on the website through a direct link to a category page (e.g. via google serp), the cookies will be set on the current path (e.g. /main-category/sub-category).

The user then adds a product to the cart (which is connected to his context) and leaves the website after that.
If the user comes back and access the website through a different page the cookies won't be found, therefore causing the code to set new cookies for the current path (and a new context in SW).

The first context is then lost for all the pages other than /main-category/sub-category and its subpages.

The tokens should be set with path='/' to avoid all this.

@fsavina fsavina added the bug Something isn't working label Jan 22, 2021
@elkmod elkmod changed the title [BUG] [BUG] No path for cookies can be provided in $cookies.set Jan 25, 2021
@mkucmus mkucmus self-assigned this Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants