Set session cookie in app accesses via POS-Link

Set session cookie in app accesses via POS-Link

Mittlus
Shopify Partner
4 0 1

I'm building an app using the Remix template and I'm currently stuck on trying to implement cookie-based session authentication (Remix Sessions):

 

 

createCookieSessionStorage({
    cookie: {
      name: "auth-session-cookie",
      secure: true,
      secrets: ["example"],
      sameSite: "none",
      maxAge: 300,
      path: "/",
    },
});

 

 

The authentication works when accessing the app through Shopify Admin but for some reason, it does not work when accessing the app via the POS.

After some testing, it seems like the returned 'Set-Cookie' header does not actually create the cookie in the built-in browser of the POS app.

 

 

return redirect("/app/auth", {
    headers: {
      "Set-Cookie": await commitSession(storageSession),
    },
});

 

 

 

Does the built-in browser of the POS support cookies at all, am I maybe missing some settings?

Replies 2 (2)

SBD_
Shopify Staff
1829 271 413

Hey @Mittlus 

 

Please post this question here: https://github.com/Shopify/shopify-app-template-remix

Scott | Developer Advocate @ Shopify 

Mittlus
Shopify Partner
4 0 1

I don't think there's an issue with the Remix implementation, as I also tried to set and read a cookie with plain Javascript (which also did not work).