I am trying to create a cookie in svelte (and I am also using svelte kit) and access it. I am want to use the cookie for authentication purposes, more specifically, to store a JWT Token.
I am tried implementing pure JS code, such as getCookie()
and setCookie()
as shown here W3Schools - JavaScript Cookies. But I can't get access to the document. I have also tried serialize from the cookie
npm package, as shown below, and I have also tried using browser as shown below.
import { serialize } from "cookie";
import { browser } from '$app/environment';
Via Active questions tagged javascript - Stack Overflow https://ift.tt/5z1NAW2
Comments
Post a Comment