Alex. Account Closed Impact 5 Jan 9, 2007 909 views 3 replies #1 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...
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...
Noobie Established Member ★ 15 ★ Impact 11 Jan 10, 2007 #2 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: Jan 10, 2007
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
T TwistMyArm Established Member ★ 15 ★ Impact 9 Jan 10, 2007 #3 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...
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...
Alex. Account Closed Impact 5 Jan 10, 2007 #4 hmm so ill have to find another way. ok will send some np.