Create cookie when user visits specific page and show div if user has said cookie

Hi team!

I am looking for some help to create a snippet of JS code that will do the following:

  • Set a cookie named ‘AUTHENTICATED’ when user visits specific page on the website.

  • The AUTHENTICATED cookie should be available across the website, not just on the page they got it.

  • The AUTHENTICATED cookie must expire at end of the session.

  • Change .private-nav class to 'display: block’ if user has the AUTHENTICATED cookie.

  • Change .private-nav class to 'display: none’ if user does not have the AUTHENTICATED cookie.

I have tried so so many things to get this to work - any help would be amazing!

Hey Damian, happy to help with this, it’s easily done.
PM me if you need help, I can show you how to install this.

You rock Michael,

Mind sending me the snippet aswell?