views:

56

answers:

3

Hi all,
i'm making a adwords-like to my clients websites only, and i wan't to put the cookies to save the information to all domains (and not just domain mydomain.com or subdomains .mydomain.com, i mean all).

Code Sample:
setcookie('var_name', 'var_value', null, "/", '.mydomain.com' );

Can anybody help me?
Thanks

+2  A: 

You cannot set a cookie for a foreign domain. That would be a serious security flaw. Just think of how easy attacks like session fixation would be.

Gumbo
+1  A: 

You can use an iframe to share and display the same information for a specific user on many pages. That's how Google Adsense and many other advertising solution work.

Kau-Boy
i have to use this... my idea was to automaticly detect the site, get keywords from site, contact server, see what type of ads it would need, and automaticly put them on the page... see http://search.microdual.com/
CuSS
A: 

Most tracking systems of this type work by embedding an image or some other object into participating sites which is served from your domain. At this point you can issue cookies from the single domain that you do control, and track the users by watching the referral data on your web requests.

Since the object is served from your domain, there's no need for the cross-domain cookies that you're asking for, which is fortunate because they're not possible to do.

Spudley