Topic: sessions and cookies gone wild (Read 1222 times)
Global Moderator
Internet Junkie
Gender:
Posts: 1807
9006 credits Members referred : 6
« on: Nov 03, 2007, 01:36:23 pm »
here is what I see in FF and IE
FF: site A is opened, which includes a script on site B. The script sets a cookie, reads it and outputs it into page A. after clicking a link to site B on site A the page on site B reads the cookie and displays it. All good and well...
IE: Same process, but the cookie content is not showing up.
In IE7 the cookie handling has to be changed in the security options in order to get this to work (i.e. 3rd party cookies have to be accepted) but even with this option changed it still works different in IE: When site A is opened the cookie is set for site B, but when trying to display the cookie content nothing shows up. Clicking the link to site B, the page does show the cookie content. After refreshing the page on site A the cookie shows.
In either case the setcookie doesn't give any error.
So here is what I need: a script on site B is running when accessing a page on site A. The script sets a cookie and has to know if the cookie was set successfully. Reading the cookie right after setting it doesn't seem to work in IE7, all works fine in FF though...
As far as I know sessions and cookies are the only way to reliably track a visitor right?
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Nov 03, 2007, 03:28:12 pm »
This works only if you lower the security settings of IE, since you make sites for others (you didn't came in touch) you need a different method
Global Moderator
Internet Junkie
Gender:
Posts: 1807
9006 credits Members referred : 6
« Reply #2 on: Nov 03, 2007, 03:38:12 pm »
yes, the question is: is there a different method? The only way I can think of is to log the referrer, IP and user agent but obviously this is not going to uniquely identify a visitor in case of proxy use.
yes, the question is: is there a different method? The only way I can think of is to log the referrer, IP and user agent but obviously this is not going to uniquely identify a visitor in case of proxy use.
store the session in the database and request the info from the other site via curl
Global Moderator
Internet Junkie
Gender:
Posts: 1807
9006 credits Members referred : 6
« Reply #4 on: Nov 03, 2007, 03:51:28 pm »
that is not possible, I have no control over what goes on on site A. The only thing that is added is a link and image:
where /12345/1/ is static. The img src is not really an image, but a php script that outputs an image. When the visitor clicks on the link he has to be redirected to the correct URL that corresponds to the random image that was served to him before.
Global Moderator
Internet Junkie
Gender:
Posts: 1807
9006 credits Members referred : 6
« Reply #7 on: Nov 03, 2007, 10:15:43 pm »
actually the whole point is to not use javascript and it's not for statistics
What I'm trying to do is show ads when javascript is disabled. My php script will check the page content and match it with available ads. The ads are then shown as an image created by the script. The trick is to send the visitor to the correct site after clicking the image ad, so I have to somehow keep track of which image has been served to which visitor.
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 5799
46391 credits Members referred : 3
« Reply #8 on: Nov 04, 2007, 12:29:12 pm »
In that case you can do one of these:
1) Creating the link, with an id mark that will help you understand where to redirect the user (I guess that's hard if you are going to use it on multiple sites)