Written by me@grafxflow
25 Jul, 2013
0
2,983
While recently working on a website I was trying to unset a cookie by resetting its expiry date back an hour using setcookie. But for some reason it would not work. Here is the code I was trying...
<?php
setcookie('CookieName', '', time()-3600);
unset($_COOKIE['CookieName']);
?>
Eventually I got it working by simply adding , '/'. So if you are having the same problem... I hope this helps.
<?php
setcookie('CookieName', '', time()-3600, '/'); // ADDED HERE //
unset($_COOKIE['CookieName']);
?>
30 Dec, 2018
24 Nov, 2013
07 Nov, 2012
Darth Maul and Micro-Organisms: Inside George Lucas's Cancelled Star Wars Sequel Trilogy
How to Automatically Convert DVD Subtitles to SRT on Mac
The $4 Billion Divorce: Inside the Awkward, Painful Sale of Lucasfilm to Disney
The Rift That Broke the Whip: Inside Lucas, Spielberg, and Harrison Ford's 'Furious Rows' Over Indiana Jones
Breaking the Endless Loop: Why Star Wars Needs an Origin Story
Founder, Grafxflow
I am a Full-stack Developer who also started delving into the world of UX/UI Design a few years back. I blog and tweet to hopefully share a little bit of knowledge that can help others around the web. I build lighting-fast dynamic content engines with Laravel, Winter CMS and Tailwind CSS. Thanks for stopping by!