Regarding clearing cookies on logout

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gauthamvignesh
Forum Newbie
Posts: 1
Joined: Tue Nov 23, 2010 1:01 am

Regarding clearing cookies on logout

Post by gauthamvignesh »

Hi,
I am new to PHP ... i need a way to delete my cookies of a browser at each logout.
Can anyone please suggest me something..

Regards,
B.Gautham Vignesh
rhaymonn23
Forum Newbie
Posts: 2
Joined: Tue Nov 23, 2010 2:02 am

Re: Regarding clearing cookies on logout

Post by rhaymonn23 »

Code: Select all

<?php
// set the expiration date to one hour ago
setcookie ("TestCookie", "", time() - 3600);
setcookie ("TestCookie", "", time() - 3600, "/~rasmus/", ".example.com", 1);
?>
Ref = http://php.net/manual/en/function.setcookie.php
Post Reply