npm install cookies cookie-cutter
Setting up the utils module for cookies which work both with server side and client side
Giving your app access to the server side cookies
We will use getInitialProps in our pages/_app.js file to check if the user already has a valid cookie on the server side before rendering the app. An alternative to this approach is using getServerSideProps.