--- Maris Kalnins <[EMAIL PROTECTED]> wrote:
> <img nocache border=0 width=2 height=1
> src=http://www.cookiedomain.com/cookies/cookies.php>

[snip]

> Php cookie registering script has the following
> cookie set operation:
> 
> setcookie("test", 1, time() + 3600, "/", "");
> 
> 
> The problem is that when executing HTML above, everything
> works fine as long as page and php script are on the same
> domain
> 
> But as soon as page is for example www.pagedomain.com and
> cookie script is still on www.cookiedomain.com No cookies
> are set no more.

Right, and this makes sense, if you think about it.

Actually, the cookie is set, but you can only set cookies for your own
domain, not someone else's. Thanks goodness, right? :-)

So, when the browser requests the resource
http://www.cookiedomain.com/cookies/cookies.php, the cookie is set within
that domain. When the browser requests a page at pagedomain.com, it is not
going to send cookies for cookiedomain.com. This is just how cookies work.

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to