|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Cookie Help
I am having problems deleting cookies...
this is how I am setting them, and this is working fine. PHP Code:
This is how I am deleting them,..err trying to delete them PHP Code:
The cookies will not delete. I can update them with new vars with no problem, they just won't delete. Any help is greatly appreciated. -- Jason |
|
#2
|
|||
|
|||
|
To delete cookies, you set them with a value of nothing or blank
setcookie("cookie1", $_SESSION[var1], time()-((3600*24)*30)); setcookie("cookie2", $_SESSION[var2], time()-((3600*24)*30)); wont delete them, because your setting a value, you need to do something like this @setcookie("cookie1", , time()-((3600*24)*30)); @setcookie("cookie2", , time()-((3600*24)*30)); or @setcookie("cookie1", 0, time()-((3600*24)*30)); @setcookie("cookie2", 0, time()-((3600*24)*30)); depends if your running it on a window or *nix server |
|
#3
|
|||
|
|||
|
here is what I have for my logout page,...
PHP Code:
Cookie is still not deleting. Am I doing something wrong here? -- Jason Last edited by Taelo : October 10th, 2002 at 11:49 AM. |
|
#4
|
|||
|
|||
|
setcookie("cookie_var1", "", time() - 3600);
setcookie("cookie_var2", "", time() - 3600); try that, that should work, unless you have some funny options turned on your sever, also as a security note, you shouldnt use cookies for a login area, as they are the far easiest to hack into. |
|
#5
|
|||
|
|||
|
well,....I don't know what I got going on here,...I can't get that cookie to delete for anything,.....
|
|
#6
|
|||
|
|||
|
Jason,
What version of PHP are you running? Do you have register_globals set on or off? What if you were to try: setcookie("cookie1", "", time()-((3600*24)*30), "", ""); Try resetting the path and domain as well.
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#7
|
|||
|
|||
|
This is What I have,...logout.php
PHP Code:
Register_globals is set to On Can you think of anything else I might try? -- Jason |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Cookie Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|