views:

2240

answers:

3

Semanticator is an e-Marketing tool that claims to choose which web page to display based on where you were before. That is, if you've been browsing truck sites and then go to Ford.com, your first page would be of the Ford Explorer.

I know you can get the immediate preceding page with HTTP_REFERRER, but how do you know where they were 6 sites ago?

+3  A: 

Javascript this should get you started: http://www.dicabrio.com/javascript/steal-history.php
There are more nefarius means to: http://ha.ckers.org/blog/20070228/steal-browser-history-without-javascript/
Edit:I wanted to add that although this works it is a sleazy marketing teqnique and an invasion of privacy.

Unkwntech
and thus probably illegal in most jurisdictions
David Schmitt
@David, can you elaborate?
Mike Daniels
@Mike: I was referring to the "invasion of privacy" part. Especially in Europe, accessing data is not always allowed, just because it is possible.
David Schmitt
A: 

You can't access the values for the entries in browser history (neither client side nor server side). All you can do is to send the browser back or forward a number of steps. The entries of the history are otherwise hidden from programmatic access.

Also note that HTTP_REFERER won't be there if the user typed the address in the URL bar instead of following a link to your page.

Andrei
+1  A: 

The browser history can't be directly accessed, but you can compare a list of sites with the user's history. This can be done because the browser attributes a different CSS style to a link that hasn't been visited and one that has.

Using this style difference you can change the content of you pages using pure CSS, but in general javascript is used. There is a good article here about using this trick to improve the user experience by displaying only the RSS aggregator or social bookmarking links that the user actually uses: http://www.niallkennedy.com/blog/2008/02/browser-history-sniff.html

Andrew Johnson