import { createCookieSessionStorage } from "remix";
      
      const sessionSecret = "YOURSESSIONSECRET";
      const { getSession, commitSession, destroySession } =
        createCookieSessionStorage({
          // a Cookie from `createCookie` or the CookieOptions to create one
          cookie: {
            name: "__session",
            // all of these are optional
            domain: "domain.tld",
            expires: new Date(Date.now() + 60),
            httpOnly: true,
            maxAge: 60,
            path: "/",
            sameSite: "lax",
            secrets: [sessionSecret],
            secure: true
          }
        });
      export { getSession, commitSession, destroySession };

      Javascript language logo
      your recipe card header background
      Create Cookie Session

      Remix JavaScript public recipes

      Create a cookie session with remix.

      Shortcut: remix.cookie.session

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.