Advanced Search

Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: May delete ALL PHP Cookies or JAVASCRIPT Cookies with one command, one visit to a par

  1. #1
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default May delete ALL PHP Cookies or JAVASCRIPT Cookies with one command, one visit to a par

    May delete ALL PHP Cookies or JAVASCRIPT Cookies with one command, one visit to a particular page (for developer/debugging)?

  2. #2
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    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.

  3. #3
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    May delete ALL PHP Cookies or JAVASCRIPT Cookies with one command, NOT A SEPARATE COMMAND FOR EACH COOKIE CREATED ? I AM WEB DEV ...

  4. #4
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    I rest my case...

  5. #5
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    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 ?

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,154
    Thanks
    261
    Thanked 690 Times in 678 Posts

    Default

    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

  7. #7
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    what about javascript ....if the same , I use same method to delete ? yes / no

  8. #8
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    php: $cs = $_COOKIE; // in javascript we have any var to be an array of cookies ?

  9. #9
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    Code:
    $cs = $_COOKIE;
    foreach ($cs as $cname=>$cvalue) {
       setcookie($cname,'',time()-3600);
    }
    with this I delete and javascript cookies along with php cookies??

  10. #10
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    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.

  11. The Following User Says Thank You to Schmoopy For This Useful Post:

    leonidassavvides (11-10-2009)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •