Dynadot — .com Transfer

[Php] setting and retriving cookies from different sites

Spaceship Spaceship
Watch

Alex.

Account Closed
Impact
5
hi, is there anyway i can set a variable in php on one site, store it in a cookie, then on another site retrive that cookie and variable?

i assume this is possible because everyone says cookies are insecure.

quick helpful replys will get some np...
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
I don't have a bit of code that i know works, but you might want to read up on some ways by using third party cookies if you want to track.
It' a good read
http://en.wikipedia.org/wiki/HTTP_cookie
http://en.wikipedia.org/wiki/Web_analytics

I've never had to face this hurdle, only over subdomains but one possible idea is
PHP:
setcookie("TestCookie", $value, time()+3600, "/", ".websitea.com", 1);
setcookie("TestCookie", $value, time()+3600, "/", ".websiteb.com", 1);
Creating multiple cookies for multiple websites if you know which sites you want to pass data to
I'm not sure if this can be done nor if its wise.

Edit: That would be pretty silly if you could actually, you could ruin someone's website by overwriting their visitors cookies
 
Last edited:
0
•••
Unless that 'site' is under the same domain name then, no, you can't do that.

Cookies for one domain cannot be accessed by another domain. It's a browser thing: the browser won't send the cookie...
 
0
•••
hmm so ill have to find another way.
ok will send some np.
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
Appraise.net

We're social

Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back