I’m trying to set the cookie to my site to button on click action ,it is working on when user logged in .When user logged out it’s not working

jQuery(document).on(‘click’, ‘#organisation’, function(event){ event.preventDefault(); jQuery.cookie(“site_changer”, “organisation”, { expires: 1 }); window.location.href = window.location.href; }); jQuery(document).on(‘click’, ‘#young-professional’, function(event){ event.preventDefault(); jQuery.cookie(“site_changer”, “young-professional”,…