Skip to main content

useShopifyCookies

Sets Shopify user and session cookies and refreshes the expiry time.

Manages Shopify cookies. If hasUserConsent option is false, Shopify cookies will be removed.

Examples
import * as React from 'react';
import {useShopifyCookies} from '@shopify/hydrogen';

export default function App({Component, pageProps}) {
useShopifyCookies({hasUserConsent: false});

return <Component {...pageProps} />;
}
Was this page helpful?