function setCookie(){ jQuery('#cookies-banner').slideUp(250); // Build the expiration date string: var expiration_date = new Date(); var cookie_string = ''; expiration_date.setFullYear(expiration_date.getFullYear() + 1); // Create/update the cookie: document.cookie = "cookies=true; path=/; expires=" + expiration_date.toGMTString(); } jQuery(document).ready(function($) { var cookie = document.cookie; if (cookie.indexOf('cookies') != -1) { return; } else { jQuery('#cookies-banner').slideDown(250); } });