How Do I Read One Cookie From Multiple Domains?

Discussion in 'PHP' started by 45n5, Oct 8, 2007.

  1. #1
    Mybloglog can read your cookie info and show your picture on any website you visit. How do they do this?

    I want to be able to set one cookie on a visitors computer and then read it from another domain.

    I WON"T know at the time I set the cookie the domains i will want to read it on.

    If mybloglog is doing it I'm sure there is a way

    thanks all for the help
     
    45n5, Oct 8, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    No, for security reasons the browser sends only the cookies from the current domain. It's impossible for you to receive cookies from other domains. The only thing you can do is read cookies from your own subdomains, but not totally different ones.

    I didn't sign up on this site or look into it in any way, but I'm sure they're not just using simple cookies.
     
    nico_swd, Oct 8, 2007 IP
  3. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If a request (for the picture) is sent to mybloglog, surely it can read its own cookies then, as the request is in its own domain?
     
    matthewrobertbell, Oct 8, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    If the image on mybloglog is requested, the browser will send all cookies from mybloglog to the image, but no information about the domain the user is currently on. (occasionally the referrer is being sent, but it's not reliable) Plus the OP never mentioned images.
     
    nico_swd, Oct 8, 2007 IP
  5. 45n5

    45n5 Peon

    Messages:
    414
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #5
    wow, thanks for the responses.

    Ultimately i would want the same functionality as mybloglog, or the ability to track users across multiple domains.

    How exactly is mybloglog doing it then if they aren't reading cookies?

    thanks again ;-)
     
    45n5, Oct 8, 2007 IP
  6. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You are right nico, but
    He did mention images :)
     
    matthewrobertbell, Oct 8, 2007 IP