Page 1 of 1
can i write cookie with from one domain to another domain
Posted: Thu Mar 10, 2005 1:22 am
by renu
how can i write cookie with from one domain to another domain.
i want to set cookie with its domain name(this file is on server) on client's machine.
Posted: Thu Mar 10, 2005 7:24 am
by Chris Corbyn
I dont get what you mean. setcookie() sets a cookie. You can specifiy the domain name in that, if that's what you are referring to. Cookies are set for the browser itself... upon viewing the page that sets the cookie.
http://www.php.net/setcookie/
(this file is on server)
Huh??
Posted: Thu Mar 10, 2005 8:17 am
by anjanesh
But isnt the cookie file contents for that particular site sent to the server ? Otherwise how could we possibly access on the server using $_COOKIES ?
Posted: Thu Mar 10, 2005 10:18 pm
by renu
Actually i have a file which generates some javascript code which will be saved at client's machine and will run from client's machine. and tht javascript code also set cookie on client's machine.so i want tht cookie to be set with my site's domain name.
Am i clear now.
Posted: Thu Mar 10, 2005 10:20 pm
by feyd
a cookie will only set to your domain.
Posted: Thu Mar 10, 2005 11:41 pm
by Buddha443556
Well if I'm not misunderstanding you ...
Use an <img src="
http://yourserver.com/cooksetter.php?client=1234" width=0 height=0> you can even pass variables. User could always reject the cookie and rejection might even be automatic. Don't forget to return an image.