How do I store a user selection to a cookie?

Hi @UKRiggers,
You can do this exactly using the state manager (cookie manager).

Create your cookie, in the cookie manager. Let’s say we call it - topmenu.
On your site (anywhere you like) add two buttons - “hide top menu” and “show top menu”.

Click the “hide top menu” button, then using the dynamic events > on click > cookie > set value. Add some value to it, let’s say “1”.

Now select your top menu, in dynamic attributes click > display > hide > when > select your cookie and add “== 1”:

The menu will be hidden if your cookie value == 1.

If you want to show it again, assign a dynamic event to “show top menu” button, which just removes cookie value.

3 Likes