Skip to content

Commit

Permalink
feat!: set default path for setCookie to /
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Apr 6, 2022
1 parent 0edec32 commit 1bd6a45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export function useCookie (event: CompatibilityEvent, name: string): string | un
* ```
*/
export function setCookie (event: CompatibilityEvent, name: string, value: string, serializeOptions?: CookieSerializeOptions) {
const cookieStr = serialize(name, value, serializeOptions)
const cookieStr = serialize(name, value, {
path: '/',
...serializeOptions
})
appendHeader(event, 'Set-Cookie', cookieStr)
}

Expand Down

0 comments on commit 1bd6a45

Please sign in to comment.