<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Tech-Recipes - Latest Comments in PHP: Delete or expire a browser cookie</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><atom:link href="https://tech-recipes.disqus.com/php_delete_or_expire_a_browser_cookie_php_programming_tech_recipes/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 26 Jul 2011 16:08:54 -0000</lastBuildDate><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-265808227</link><description>&lt;p&gt;Thanks dude...u owe me.....&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Vkijust4u</dc:creator><pubDate>Tue, 26 Jul 2011 16:08:54 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-204948417</link><description>&lt;p&gt; Recommended by who? Here is a simple explanation why 1 is better than any of these mathematical calculations inside of setcookie command.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kirill</dc:creator><pubDate>Tue, 17 May 2011 06:04:24 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-151051622</link><description>&lt;p&gt;nice this is smart programming&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">sandip kalbhile</dc:creator><pubDate>Fri, 18 Feb 2011 04:52:15 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-138100270</link><description>&lt;p&gt;Hi Experts,&lt;/p&gt;&lt;p&gt;just i want to know about how to create cookies using CORE PHP&lt;/p&gt;&lt;p&gt;Advance Thanks&lt;/p&gt;&lt;p&gt;Regards&lt;br&gt;Mr . Dhenu&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">boopathi</dc:creator><pubDate>Tue, 01 Feb 2011 06:17:40 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-134650804</link><description>&lt;p&gt;no don't use unset() use setcookie()&lt;br&gt;the main unsuccessfull delete or expire cookie is because you made a cookie in dive folder inside host and you can't delete in diferent folder outside you made and cookie path is set value already.&lt;/p&gt;&lt;p&gt;for better security and successfully use :&lt;br&gt;setcookie("cookiename","",mktime(12,0,0,1, 1, 1990), "/");&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">c0debreaker</dc:creator><pubDate>Wed, 26 Jan 2011 00:22:32 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-127735605</link><description>&lt;p&gt;Don't use unset($_COOKIE['variablename']). That will only unset the variable from the $_COOKIE superglobal array, it will not expire (delete) the cookie itself.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jarrod Christman</dc:creator><pubDate>Tue, 11 Jan 2011 14:59:15 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-125133739</link><description>&lt;p&gt;Somehow it seems you always need to know the 'name of a cookie'...But if you don't know this?&lt;/p&gt;&lt;p&gt;I am busy with protecting pages from a Wordpress website. Protecting works fine...but now I want provide a 'log out' button somewhere...but whatever I do...people stay logged in.&lt;/p&gt;&lt;p&gt;I want them to click on the 'log out' button and then end up on the startpage of the website...on which are 2 options: enter website - member login&lt;/p&gt;&lt;p&gt;All Javascript and PHP trickery I have tried always need the name of the Cookie.&lt;/p&gt;&lt;p&gt;And when I get the name of the Cookie (with the webdevelopers toolbar in Firefox) and put this in the right position...it never works,&lt;/p&gt;&lt;p&gt;Help is needed...sigh...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erick S.</dc:creator><pubDate>Thu, 06 Jan 2011 14:38:43 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-123789342</link><description>&lt;p&gt;Only the following worked for me:&lt;/p&gt;&lt;p&gt;unset($_COOKIE['the_cookie_name']);&lt;/p&gt;&lt;p&gt;Thanks Webmaster Trainman2k&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">middlewhere</dc:creator><pubDate>Tue, 04 Jan 2011 01:37:50 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-121040702</link><description>&lt;p&gt;now i can easily delete cookies..&lt;br&gt;Thank you...!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">developer in php</dc:creator><pubDate>Thu, 30 Dec 2010 04:22:04 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-115904704</link><description>&lt;p&gt;To delete a cookie by resetting it has severe and drastic limits.&lt;br&gt;I have found that when using PHP, after the header has had any output, you cannot 'reset' a cookie that way to make it expire.&lt;/p&gt;&lt;p&gt;In my opinion, a better way, (from a PHP programers' view), is to use:&lt;br&gt;   unset($_COOKIE['the_cookie_name']);&lt;/p&gt;&lt;p&gt;From my experience, doing it this way, you can delete a cookie anywhere within the PHP code without a problem and not restricted to when or where you delete it..&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Webmaster Trainman2k</dc:creator><pubDate>Tue, 21 Dec 2010 03:17:55 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-58193828</link><description>&lt;p&gt;i have been using this trick and it is good but its not working for my site.&lt;br&gt;can it be a problem with my host?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Arpit</dc:creator><pubDate>Wed, 23 Jun 2010 04:28:01 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-45068968</link><description>&lt;p&gt;Thanks for the tip!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">richhessler</dc:creator><pubDate>Thu, 15 Apr 2010 21:16:18 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-39962431</link><description>&lt;p&gt;You notice that the time different between server and client will make the cookie deletion unsuccessful. Don't assume time between server and client cannot be different more than 1 hour. If I browse your site in different time zone, the cookie possibly not to be deleted. Thus we need to set the time more than 24hours in the past.&lt;br&gt;Easier to write setcookie('user','',1)&lt;br&gt;But recommended to write setcookie('user','',time()-60*60*24*2) // 2days past.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">LaNN</dc:creator><pubDate>Mon, 15 Mar 2010 21:14:15 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-24960747</link><description>&lt;p&gt;Good article for php beginer )&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Artem Egorov</dc:creator><pubDate>Sun, 06 Dec 2009 16:12:26 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-17692241</link><description>&lt;p&gt;Good Idea. This is a smart way to delete cookies.&lt;br&gt;Thanks&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">hnurzaman</dc:creator><pubDate>Sun, 27 Sep 2009 19:22:35 -0000</pubDate></item><item><title>Re: PHP: Delete or expire a browser cookie</title><link>http://www.tech-recipes.com/rx/1501/php_delete_or_expire_a_browser_cookie/#comment-17237595</link><description>&lt;p&gt;Nice trick!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Román</dc:creator><pubDate>Wed, 23 Sep 2009 15:45:27 -0000</pubDate></item></channel></rss>