Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing cookies from one domain to the other

Status
Not open for further replies.

fortytwo

Technical User
Apr 18, 2000
206
GB
Hi All,

I am really stuck on this one. I need to set a cookie on one domain that is then readable by a PHP script on another domain.

If I set the cookie from like this:

[tt]$cookie = setcookie ("verio", value, $exp, "/sub/directory/", "www.verio.co.uk");[/tt]

I can then read it from but if I set a cookie on like this:

[tt]$cookie = setcookie ("verio", value, $exp, "/directory/", "www.veriouk.com");[/tt]

I cannot read the cookie from which is were I need to read it from. The scripts that read in the cookie are the same on both the servers and just use the line:

[tt]echo $verio[/tt]

I have double checked everything and I am sure I am doing this as specified at php.net.

I would really appreciate some help on this.

I noticed on the preview screen for this message that the forum has put in an extra semicolon just before the last bracket oneach of the set cookie lines. This is not actually there.

Thanks



fortytwo
will@hellacool.co.uk
 
Try
$cookie = setcookie ("verio", value, $exp, "/", "";);
 
Not sure how/if what you ask can be done, but if not, just read the cookie from the first domain, get the values, then set a new cookie from your new domain with the same values.
 
Thanks carloslau and Inssider,

Inssider: The problem is getting the information from one domain to another (different server) in the first place, hence the cookie.

The cookie actually will only contain a unique ID which means we will be able to match one set of data from one srever to the other for a particular ID.



fortytwo
will@hellacool.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top