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”, { expires: 1 });
window.location.href = window.location.href;
});

}
add_action(“wp_head”, “cookiebasedredirect”);

Read more here:: 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

Leave a Reply

Your email address will not be published. Required fields are marked *