Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   Delete Cookie .. (http://www.programmingforums.org/showthread.php?t=10642)

ASHORY Jul 6th, 2006 4:15 PM

Delete Cookie ..
 
Hey .

I am working on a loggin system built on setting cookies for users ,
setcookie(Username, Value, time()+300);
//Cookie Ends after 5 Minutes

and now i want to logout this user so i used to delete the cookie
setcookie(Username, Value, mktime(12,0,0,1, 1, 1990));
//Cookie will end at past time so it will be deleted immediatly


so after all of that , the cookie still exist i dont know what to do

please any one help me


Booooze Jul 6th, 2006 6:44 PM

I recall there being a simpler way to reset or delete cookies. If you google this topic, you will find that you should be able to reset a cookie by simply specifying it name only.

:

setcookie("test");

That code would reset the cookie named test to basicly nothing.

BlazingWolf Jul 9th, 2006 8:48 PM

[php]setcookie("cookiename", "", time()-300);[/php]

ASHORY Jul 10th, 2006 2:09 PM

@BlazingWolf
My Code is Similar to yours and its didnt work

@Booooze
The Code didnt work to so when i go to the url to the page it must say "you r not signed in" but it worked , i waited till the cookie expired and it said that successfully , so whats wrong


All times are GMT -5. The time now is 3:01 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC