Help with Cookie Please

Hi Guys, the code below displays a popup after 60 seconds on page load. It stores a cookie that prevents the popup showing on every page though, which then expires when the session ends. However, what I need is for the popup to fire when browsing any page, but only display once per user session, if that makes sense?

[php]$(document).ready(function() {
if($.cookie(‘form-cookie’) == null)
{
setTimeout(function(){
$(’#form’).modal(‘show’);
}, 60000);
$.cookie(‘form-cookie’, ‘str’);
}
else
{
$(“div#form.modal”).css(‘display’,‘none’);
}
});
}[/php]

Thanks for any help, I’m new to this…

Set an expiration on the cookie. That should do what you are after.

Thanks for your reply. I’m new to this, can you show me how I would achieve this please with the code above?

Many thanks

I don’t want to rob you of the experience.

Sponsor our Newsletter | Privacy Policy | Terms of Service