how to destroy a cookie by php condition

I want to destroy the cookie by the php condition but i have not got anything to do that after the lots of research on the google and php manual . i have read at some place that setcookie('cookie_name'); but it just erase the cookie so my question is that how to destroy cookie by php ?

Answers


When deleting a cookie you should assure that the expiration date is in the past, to trigger the removal mechanism in your browser

setcookie ("cookie_name", "", time() - 3600); // set the expiration date to one hour ago

Manual.


Need Your Help

CSS overlay on images

html css

I want to simply overlay these 4 images with a block of colour, and text aligned in the middle of each. But with my current use of "position: absolute" to get each image in the correct position and

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.