Hi, All, I just got my first web application up and running. It feels so exciting even though I'm still so junior. Now, next project since I'm already so addicted: I wonder if it's possible to write a php script to keep track of each move on a remote browser. For example, 1) I log into apple.com as MacFang from a client browser; 2) I then go to cnn.com by changing URL in the location bar while still logged in as MacFang at apple.com; Is there a way apple.com can detect each site I go to for as long as I'm logged in as MacFang?
The key is how does apple.com get to know that MacFang sent a request to cnn.com through the client browser where MacFang is logged in?
Any thoughts or suggetions are greatly appreciated.
Not really. The first thing to remember is that as owner of apple.com, you'd have no right to know about the browsing habbits of the user once I leave apple.com.
The easiest way to track a browser is to use the REFERRER which is *usually* but not *always* set by the browser. The catch is, that if I enter a new URL into the browser address bar, the referrer will NOT be set, because it's not a *referrer*. Linking to the second site might help the referrer be passed on, but of course the referrer can still be faked and/or not sent by the browser.
The second easiest way is by using cookies (which is probably what apple.com use for log-in), but the simple answer is that a cookie can only be read by the original server that set the cookie. In other words, cnn.com can't read a cookie set by apple.com (in most cases, but there are work-arounds). Of course I don't need to remind you that cookies can be refused by the user.
What IS possible is that apple.com can act is a gateway for cnn.com, which means to access cnn.com, you do it via this URL:
http://www.apple.com/redirect.php?url=http://www.cnn.com/dir/dir/ page.html
Of course, this would DEFINITELY require an agreement by both site owners in advance, and there will be definite problems and confusion along the way.
You don't have a right to know where I go after I leave your site. This is backed up by the fact that it's technically impossible (or at least difficult) to do so.
Justin
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php