--- title: getShopifyCookies description: Parses cookie string and returns Shopify cookies. api_version: 2025-07 api_name: hydrogen source_url: html: 'https://shopify.dev/docs/api/hydrogen/latest/utilities/getshopifycookies' md: 'https://shopify.dev/docs/api/hydrogen/latest/utilities/getshopifycookies.md' --- # get​Shopify​Cookies Parses cookie string and returns Shopify cookies. ## get​Shopify​Cookies([cookies](#getshopifycookies-propertydetail-cookies)​) If the Shopify cookies doesn't exist, this method will return empty string for each missing cookie. ### Parameters * cookies string required ### Returns * ShopifyCookies ### ShopifyCookies * \_shopify\_s string Shopify session token: Value of `_shopify_s` cookie. * \_shopify\_y string Shopify unique user token: Value of `_shopify_y` cookie. ### ShopifyCookies * \_shopify\_s Shopify session token: Value of \`\_shopify\_s\` cookie. ```ts string ``` * \_shopify\_y Shopify unique user token: Value of \`\_shopify\_y\` cookie. ```ts string ``` ```ts { /** Shopify unique user token: Value of `_shopify_y` cookie. */ [SHOPIFY_Y]: string; /** Shopify session token: Value of `_shopify_s` cookie. */ [SHOPIFY_S]: string; } ``` ## ShopifyCookies Shopify cookies names * \_shopify\_s string required Shopify session token: Value of `_shopify_s` cookie. * \_shopify\_y string required Shopify unique user token: Value of `_shopify_y` cookie. ### Examples * #### Example code ##### Description I am the default example ##### JavaScript ```jsx import * as React from 'react'; import {useEffect} from 'react'; import {getShopifyCookies} from '@shopify/hydrogen'; export default function App({Component, pageProps}) { useEffect(() => { getShopifyCookies(document.cookie); }); return ; } ``` ##### TypeScript ```tsx import * as React from 'react'; import {useEffect} from 'react'; import {getShopifyCookies} from '@shopify/hydrogen'; export default function App({Component, pageProps}) { useEffect(() => { getShopifyCookies(document.cookie); }); return ; } ``` ## Related [Hook - useShopifyCookies](https://shopify.dev/api/hydrogen/hooks/useShopifyCookies)