May delete ALL PHP Cookies or JAVASCRIPT Cookies with one command, one visit to a particular page (for developer/debugging)?
May delete ALL PHP Cookies or JAVASCRIPT Cookies with one command, one visit to a particular page (for developer/debugging)?
You really need to try and explain yourself better, I don't have a clue what you mean. What is the question or the problem you're having?
Have you gone to a site that's deleted all your cookies? Do you want to make a page that deletes all the user's cookies? Or what?
Please try and make sense when posting. A lot of your posts seem to have just random words thrown together.
May delete ALL PHP Cookies or JAVASCRIPT Cookies with one command, NOT A SEPARATE COMMAND FOR EACH COOKIE CREATED ? I AM WEB DEV ...
I rest my case...
we use setcookie(to old date) in js for each(many commands), may do ALL WORK(DELETE ALL SITE'S COOKIES FOR A USER) With one command ?
No. There is not one command that deletes all the cookies.
You can gather a list of all the cookies and then delete them individually.
PHP Code:
$cs = $_COOKIE;
foreach ($cs as $cname=>$cvalue) {
setcookie($cname,'',time()-3600);
}
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
what about javascript ....if the same , I use same method to delete ? yes / no
php: $cs = $_COOKIE; // in javascript we have any var to be an array of cookies ?
with this I delete and javascript cookies along with php cookies??Code:$cs = $_COOKIE; foreach ($cs as $cname=>$cvalue) { setcookie($cname,'',time()-3600); }
The cookies aren't separate to the two languages. It's just two different ways of doing the same thing.
The way mentioned above is how to delete cookies in PHP, but you could also do the same by using JavaScript, it doesn't change the outcome.
Summary: It doesn't matter which language you use, JavaScript, or PHP, they are both capable of deleting the user's cookies.
leonidassavvides (11-10-2009)
Bookmarks