Cookies: Set for host rather than domain

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hi all,

I've tried all sorts of code to try and get this to work, but alas...

Setting cookies, appears to set for the domain rather than the hostname.
I've tried hardcoding, using via $_SERVER['HTTP_HOST'], prepending and
not prepending the host with a . (dot) but every time, it always sets
the cookie with the prepending dot making the cookie active for the
entire domain.

I've also tried auto-assignment of the host (ie: not setting the value
within setcookie()) and defining it myself with the same results.

The PHPSESSID cookie when set is fine, as defined within php.ini but
using setcookie() just doesn't want to play ball.

This is happening on both PHP4.3.2 and PHP4.2.2.

Anyone else come across this before and know a solution? I've googled
until I'm blue in the face and everything appears to say that the
default setting is host rather than domain, but this isn't the case for
me, neither can I see anywhere within php.ini to set the host / domain
value for the setcookie() function.

Any thoughts / ideas appreciated =)




digiServ Network
London, UK /

Site Timeline