Skip to content

Commit

Permalink
dont put '-cart-id' after cookie key
Browse files Browse the repository at this point in the history
  • Loading branch information
julianbenegas committed Apr 14, 2023
1 parent 8c8b416 commit cc3b7fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/hooks/src/helpers/use-cart-cookie-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ export const useCartCookieManager = (key: string) => {
return {
set: (id: string) => {
if (!isClient) return
Cookies.set(`${key}-cart-id`, id, {
Cookies.set(key, id, {
sameSite: 'strict',
secure: true,
expires: 365 // one year
})
},
get: () => {
if (!isClient) return
return Cookies.get(`${key}-cart-id`)
return Cookies.get(key)
},
clear: () => {
if (!isClient) return
return Cookies.remove(`${key}-cart-id`)
return Cookies.remove(key)
}
}
}, [key])
Expand Down

0 comments on commit cc3b7fc

Please sign in to comment.