Created
June 30, 2021 11:57
-
-
Save yoovanr/cba748ea0bfc609055a5fb781e64425b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pages/index.js | |
import React, { useEffect } from 'react' | |
import CookiesUtils from '../utils/cookies' | |
const HomePage = () => { | |
useEffect(() => { | |
CookiesUtils.getItem('server-side-cookies') // Output: Aloha from server side cookies! | |
CookiesUtils.setItem('client-side-cookies', 'Aloha from client side cookies!') | |
CookiesUtils.getItem('client-side-cookies') // Output: Aloha from client side cookies! | |
}, []) | |
// ... | |
} | |
export default HomePage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment