Skip to content

Tag: cookies

Destroy cookie when browser window closes PHP

I have created a popup in WordPress that will open when visitor IP is from Australia. The popup will show up on page load. I want to make it not show until the browser screen is closed. For this, I used the cookie. I set the cookie when the close button is clicked and creating the cookie in PHP using

Cookie aren’t saved

I need to save a cookie, I’m trying to do this with setcookie function, I did: in the browser there is no cookie saved, why? Answer Some of your settings are wrong. I’ve corrected can you try?

Setting Cookie on click

I’m having an issue creating / setting a cookie on the click of a link, is there a proper way to do this? Either PHP or Javascript is fine. Obviously both JS and PHP wouldn’t exist in the same instance it was just to show what I have. Answer You can’t mix JavaScript and PHP. By the time your…