1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Check if specific cookie exists - is this possible?

Discussion in 'PHP & Perl' started by darkstar69, Jul 5, 2012.

  1. darkstar69

    darkstar69 Jr. VIP Jr. VIP

    Joined:
    Nov 15, 2008
    Messages:
    806
    Likes Received:
    880
    Occupation:
    Big Boss
    Location:
    On The Dark Side
    Hello,
    I´d like to know if it´s possible to check if a specific cookie from a domain that I don´t own exists.
    So far I found if(isset($_COOKIE['CookieName'])) but seems that it only checks cookies from the own domain.
    I would need to check if a cookie from a third party comain exists.
    For example if I want to check if a cookie from google.com exists:

    Code:
    <?php
    if( isset( $_COOKIE['googlecookie'] ) )
    {
    echo 'google cookie exists';
    }
    else
    {
    echo 'no google cookie found';
    }
    ?>
    Again, I only want to check if the cookie of specific domains exists, I don´t want to change/delete/alter/download/whatever the cookie.
    I only want to check whether there is such cookie or not.
     
  2. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,143
    I think it 's restricted by the browser security model.
     
  3. darkstar69

    darkstar69 Jr. VIP Jr. VIP

    Joined:
    Nov 15, 2008
    Messages:
    806
    Likes Received:
    880
    Occupation:
    Big Boss
    Location:
    On The Dark Side
    That´s what I already suspected.
    But I thought the browser security only prevents you to change, delet or alter cookies from other domains.
    And because I only want to check the presence of the cookie I thought maybe there is a way to check it.
     
  4. OriginalEXE

    OriginalEXE Power Member

    Joined:
    Feb 6, 2012
    Messages:
    634
    Likes Received:
    664
    Occupation:
    WordPress developer
    Home Page:
    It is not possible.
     
  5. blacknight9

    blacknight9 Newbie

    Joined:
    Jan 1, 2009
    Messages:
    44
    Likes Received:
    37
    Home Page:
    No, sorry. The www will be a huge mess if you can do this.
     
  6. darkstar69

    darkstar69 Jr. VIP Jr. VIP

    Joined:
    Nov 15, 2008
    Messages:
    806
    Likes Received:
    880
    Occupation:
    Big Boss
    Location:
    On The Dark Side
    Hm ok, then I have to think about something else.
    Thanks anyway.
     
  7. upl8t

    upl8t Regular Member

    Joined:
    Apr 9, 2008
    Messages:
    475
    Likes Received:
    84
    Location:
    New Scotland
    Serious security risk. That was closed down a long time ago.
     
  8. williamk

    williamk BANNED BANNED

    Joined:
    Oct 29, 2009
    Messages:
    1,030
    Likes Received:
    184
    Yes it is easy. Just go to options> privacy> remove indicidual cookies and the search by domain name.
    But this is for firefox.
     
  9. darkstar69

    darkstar69 Jr. VIP Jr. VIP

    Joined:
    Nov 15, 2008
    Messages:
    806
    Likes Received:
    880
    Occupation:
    Big Boss
    Location:
    On The Dark Side
    I don´t want to check in my own browser.
    Of course I know how to check it myself onm my own pc.
    Thanks anyway
     
  10. zackm

    zackm Junior Member

    Joined:
    Dec 11, 2010
    Messages:
    145
    Likes Received:
    26
    Last edited: Jul 31, 2012
  11. loki_

    loki_ Registered Member

    Joined:
    May 20, 2012
    Messages:
    63
    Likes Received:
    8
    Location:
    #!/bin/bash/
    cookies are domain specific... I mean if they werent then i'd have access to the facebook accounts of give or take anyone who ever visited my website...
     
  12. sockpuppet

    sockpuppet Junior Member

    Joined:
    Nov 7, 2011
    Messages:
    155
    Likes Received:
    145
    CSS history hack doesn't work anymore.