Re: [PHP] Too Advanced? Re: Cookies Hidden Image
--- Nicole [EMAIL PROTECTED] wrote: The problem is accessing the cookie when the script is called via the image tag. If the script is called directly, the cookie is accessible. http://trackerurl/blahblah/script.php --- called directly can see the Cookie img src=http://trackerurl/blahblah/script.php height=1 width=1 --- does not see the Cookie Is this with Internet Explorer by chance? If so, see if your results differ when using a different browser. If you can call the resource (http://trackerurl/blahblah/script.php) directly and get different results than when the resource is referenced as an img tag, then something is definitely abnormal. You might be running into a P3P problem, which I can explain further if my suspicions are correct. Something that would *really* help us is the HTTP request and HTTP response from these two transactions: 1. http://trackerurl/blahblah/script.php is accessed directly by the browser. 2. The browser accesses a page that references http://trackerurl/blahblah/script.php in an img tag. If you are running Windows (my assumption, no offense intended), you can use ethereal to get this information. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Too Advanced? Re: Cookies Hidden Image
--- Mark Charette [EMAIL PROTECTED] wrote: It's not a PHP thing, it's an HTML protocol thing ... I think you mean HTTP. :-) HTML is a markup language. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too Advanced? Re: Cookies Hidden Image
Thanks. The cookie sets fine using the redirect. The problem is accessing the cookie when the script is called via the image tag. If the script is called directly, the cookie is accessible. http://trackerurl/blahblah/script.php--- called directly can see the Cookie img src=http://trackerurl/blahblah/script.php height=1 width=1--- does not see the Cookie Not sure what else to do other than try something different. Using Cookie seems to be the only way to store the value on the client side for later retrieval. Thanks, Nicole Diego Fulgueira [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Nothing is too advanced for this newgroup and there is not other better. I did not read your problem very carefully, but I think you are trying to set a cookie on a page that does a redirect, that is just impossible unless you do the redirect with a meta tag on the client. Anyway, if that suggestion doesn't do it for you, I once used the following function to set cookies and it worked for me: function MySetCookie ($CkyName, $CkyVal, $exp, $pth, $Domain) { $exp = strftime(%A, %d-%b-%Y %H:%M:%S, $exp); $cookiestr = sprintf (%s=%s; domain=%s; path=%s; expires=%s, $CkyName, $CkyVal, $Domain, $pth, $exp); $mycky = (isset($mycky) ? $mycky\n : ).Set-Cookie: $cookiestr; header($mycky); } Cheers, Diego - Original Message - From: Nicole [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 03, 2003 3:57 PM Subject: [PHP] Too Advanced? Re: Cookies Hidden Image Is this question too advanced for this newsgroup? Is there a better newsgroup to post this one too? Thanks, -- Nicole Nicole [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I am working on a script that uses cookie to store some info on the client side. The user will click a link that contains info about where the link was placed. The script will then store that info so that when the user returns later and makes a purchase, I can see where they came from. The problem I am having is this: The link is a redirect url that first goes to one domain where the cookie is created by. Then they are taken to the site where products are sold. Then, after they make a purchase, they are taken to a thank you page that has a hidden tracker to track that sale. img src=http://trackerurl.com/?var=1var=2blahbla height=0 width= The image loads the script from a different domain (where the cookie was initialy created by). The problem now is that the script gets a blank cookie when using the hidden image to load the script. So does anyone know why this is happening? I have setCookie('CookieName', $value, $expires); Then I try to retrieve that cookie again later with $_COOKIE['CookieName'] ... but the value stored is not there when the script is called from the hidden image. HOWEVER, the value is there when the script is called directly. Any ideas? Thanks!! Nicole -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too Advanced? Re: Cookies Hidden Image
Nicole wrote: Not sure what else to do other than try something different. Using Cookie seems to be the only way to store the value on the client side for later retrieval. How about using a session and passing the session ID in the URL for the cookie? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Too Advanced? Re: Cookies Hidden Image
From: Nicole [mailto:[EMAIL PROTECTED] Thanks. The cookie sets fine using the redirect. The problem is accessing the cookie when the script is called via the image tag. If the script is called directly, the cookie is accessible. Images have their own connection (which is why you can see a page before an image is downloaded, and why pages resize if width height are not set on the image). Cookie values via images are not passed to parent, though judicious use of javascript _may_ be able to retrieve the value - I've not seen it done, but it _might_ be possible, though I doubt it. It's not a PHP thing, it's an HTML protocol thing ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too Advanced? Re: Cookies Hidden Image
I don't accept third party cookies. Maybe your browser is set up so it does not too. Check the privacy security settings. Nicole wrote: The cookie is being accessed by the same domain it was generated by. The problem is, the script is being pulled up via a hidden image (which resides on a different domain). So that may still be the problem anyway. Thanks. -- Ernest E Vogelsinger [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] At 23:55 03.09.2003, Nicole said: [snip] But the script just gets a blank cookie when accessed this way(via hidden image); However, if the script was accessed directly, or the thankyou page resided on the same domain as the tracking script (which created the cookie to begin with), the cookie has the value that it was set with. [snip] That's it - cookies will only be sent to the same domain (hostname) they have been generated at. You cannot pass cookies between domains (hostnames). -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Too Advanced? Re: Cookies Hidden Image
Is this question too advanced for this newsgroup? Is there a better newsgroup to post this one too? Thanks, -- Nicole Nicole [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I am working on a script that uses cookie to store some info on the client side. The user will click a link that contains info about where the link was placed. The script will then store that info so that when the user returns later and makes a purchase, I can see where they came from. The problem I am having is this: The link is a redirect url that first goes to one domain where the cookie is created by. Then they are taken to the site where products are sold. Then, after they make a purchase, they are taken to a thank you page that has a hidden tracker to track that sale. img src=http://trackerurl.com/?var=1var=2blahbla height=0 width= The image loads the script from a different domain (where the cookie was initialy created by). The problem now is that the script gets a blank cookie when using the hidden image to load the script. So does anyone know why this is happening? I have setCookie('CookieName', $value, $expires); Then I try to retrieve that cookie again later with $_COOKIE['CookieName'] ... but the value stored is not there when the script is called from the hidden image. HOWEVER, the value is there when the script is called directly. Any ideas? Thanks!! Nicole -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too Advanced? Re: Cookies Hidden Image
--- Nicole [EMAIL PROTECTED] wrote: Is this question too advanced for this newsgroup? Somehow I doubt it. But, that's a nice tactic for grabbing some attention. :-) Show us some sample code of a very small test case. I can't really follow your description of what you are trying to do. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too Advanced? Re: Cookies Hidden Image
OK. Thanks. I have the hidden image code: img src=http://thetrackingurl/?param1=val1param2=val2etc... height=0 width=0 border=0 This hidden image code is placed on the ThankYou page that people see after they have bought something. What it does is load a script on the tracking site to let the owner know a sale was made. The tracking site is different from the site that the product is sold on. A cookie was placed on the client's (buyer) side to store where that client originated from. So when the hidden image is called, the tracking script is called and tries to access this cookie to retrieve where the buyer came from. But the script just gets a blank cookie when accessed this way(via hidden image); However, if the script was accessed directly, or the thankyou page resided on the same domain as the tracking script (which created the cookie to begin with), the cookie has the value that it was set with. Does this make sense? Thanks for any input. PHP's docs on sessions didn't seem to have anything relating to this situation; so I'm stuck. Nicole Chris Shiflett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] --- Nicole [EMAIL PROTECTED] wrote: Is this question too advanced for this newsgroup? Somehow I doubt it. But, that's a nice tactic for grabbing some attention. :-) Show us some sample code of a very small test case. I can't really follow your description of what you are trying to do. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Too Advanced? Re: Cookies Hidden Image
Nicole mailto:[EMAIL PROTECTED] on Wednesday, September 03, 2003 2:56 PM said: But the script just gets a blank cookie when accessed this way(via hidden image); However, if the script was accessed directly, or the thankyou page resided on the same domain as the tracking script (which created the cookie to begin with), the cookie has the value that it was set with. If I understand you correctly, you are either leaving out important details that would prevent my solution from working, or you're just making it difficult for yourself because you're a masochist. ;) Why don't you just send all the data you need to send via the url in the img tag instead of relying on the cookie? Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too Advanced? Re: Cookies Hidden Image
At 23:55 03.09.2003, Nicole said: [snip] But the script just gets a blank cookie when accessed this way(via hidden image); However, if the script was accessed directly, or the thankyou page resided on the same domain as the tracking script (which created the cookie to begin with), the cookie has the value that it was set with. [snip] That's it - cookies will only be sent to the same domain (hostname) they have been generated at. You cannot pass cookies between domains (hostnames). -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too Advanced? Re: Cookies Hidden Image
The cookie is being accessed by the same domain it was generated by. The problem is, the script is being pulled up via a hidden image (which resides on a different domain). So that may still be the problem anyway. Thanks. -- Ernest E Vogelsinger [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] At 23:55 03.09.2003, Nicole said: [snip] But the script just gets a blank cookie when accessed this way(via hidden image); However, if the script was accessed directly, or the thankyou page resided on the same domain as the tracking script (which created the cookie to begin with), the cookie has the value that it was set with. [snip] That's it - cookies will only be sent to the same domain (hostname) they have been generated at. You cannot pass cookies between domains (hostnames). -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too Advanced? Re: Cookies Hidden Image
--- Nicole [EMAIL PROTECTED] wrote: img src=http://thetrackingurl/?param1=val1param2=val2etc... [snip] The tracking site is different from the site that the product is sold on. A cookie was placed on the client's (buyer) side to store where that client originated from. So when the hidden image is called, the tracking script is called and tries to access this cookie to retrieve where the buyer came from. I think I understand now. I think you are understanding everything except how a request is made for an embedded resource such as an image. These requests are identical to the requests for the parent resource. First, let us make up some domains, so that this is clear: 1. store.org - where the user is making the purchase 2. track.org - where the image is located The cookie is being set as the user is browsing store.org, correct? As such, it will only be sent in future requests for resource within store.org's domain. When the browser requests the image from track.org, the domain is different, so the cookie is not sent. This is no different than why cookies for php.net aren't sent to amazon.com. Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too Advanced? Re: Cookies Hidden Image
Nicole wrote: I have the hidden image code: img src=http://thetrackingurl/?param1=val1param2=val2etc... height=0 width=0 border=0 This hidden image code is placed on the ThankYou page that people see after they have bought something. What it does is load a script on the tracking site to let the owner know a sale was made. The tracking site is different from the site that the product is sold on. A cookie was placed on the client's (buyer) side to store where that client originated from. So when the hidden image is called, the tracking script is called and tries to access this cookie to retrieve where the buyer came from. But the script just gets a blank cookie when accessed this way(via hidden image); However, if the script was accessed directly, or the thankyou page resided on the same domain as the tracking script (which created the cookie to begin with), the cookie has the value that it was set with. Do you set the cookie on thetrackingurl? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too Advanced? Re: Cookies Hidden Image
Nothing is too advanced for this newgroup and there is not other better. I did not read your problem very carefully, but I think you are trying to set a cookie on a page that does a redirect, that is just impossible unless you do the redirect with a meta tag on the client. Anyway, if that suggestion doesn't do it for you, I once used the following function to set cookies and it worked for me: function MySetCookie ($CkyName, $CkyVal, $exp, $pth, $Domain) { $exp = strftime(%A, %d-%b-%Y %H:%M:%S, $exp); $cookiestr = sprintf (%s=%s; domain=%s; path=%s; expires=%s, $CkyName, $CkyVal, $Domain, $pth, $exp); $mycky = (isset($mycky) ? $mycky\n : ).Set-Cookie: $cookiestr; header($mycky); } Cheers, Diego - Original Message - From: Nicole [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 03, 2003 3:57 PM Subject: [PHP] Too Advanced? Re: Cookies Hidden Image Is this question too advanced for this newsgroup? Is there a better newsgroup to post this one too? Thanks, -- Nicole Nicole [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I am working on a script that uses cookie to store some info on the client side. The user will click a link that contains info about where the link was placed. The script will then store that info so that when the user returns later and makes a purchase, I can see where they came from. The problem I am having is this: The link is a redirect url that first goes to one domain where the cookie is created by. Then they are taken to the site where products are sold. Then, after they make a purchase, they are taken to a thank you page that has a hidden tracker to track that sale. img src=http://trackerurl.com/?var=1var=2blahbla height=0 width= The image loads the script from a different domain (where the cookie was initialy created by). The problem now is that the script gets a blank cookie when using the hidden image to load the script. So does anyone know why this is happening? I have setCookie('CookieName', $value, $expires); Then I try to retrieve that cookie again later with $_COOKIE['CookieName'] ... but the value stored is not there when the script is called from the hidden image. HOWEVER, the value is there when the script is called directly. Any ideas? Thanks!! Nicole -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too Advanced? Re: Cookies Hidden Image
Hi Nicole, You can not retrieve information stored in a cookie which set by one domain from some other domain. Try passing all the information you want with the image SRC tag. regards Viraj Nicole wrote: OK. Thanks. I have the hidden image code: img src=http://thetrackingurl/?param1=val1param2=val2etc... height=0 width=0 border=0 This hidden image code is placed on the ThankYou page that people see after they have bought something. What it does is load a script on the tracking site to let the owner know a sale was made. The tracking site is different from the site that the product is sold on. A cookie was placed on the client's (buyer) side to store where that client originated from. So when the hidden image is called, the tracking script is called and tries to access this cookie to retrieve where the buyer came from. But the script just gets a blank cookie when accessed this way(via hidden image); However, if the script was accessed directly, or the thankyou page resided on the same domain as the tracking script (which created the cookie to begin with), the cookie has the value that it was set with. Does this make sense? Thanks for any input. PHP's docs on sessions didn't seem to have anything relating to this situation; so I'm stuck. Nicole Chris Shiflett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] --- Nicole [EMAIL PROTECTED] wrote: Is this question too advanced for this newsgroup? Somehow I doubt it. But, that's a nice tactic for grabbing some attention. :-) Show us some sample code of a very small test case. I can't really follow your description of what you are trying to do. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php