Bug #16342 Updated: can not set cookie with domain specified

From: Date: Sat, 13 Apr 2002 22:52:51 +0000
Subject: Bug #16342 Updated: can not set cookie with domain specified
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-4926@lists.php.net to get a copy of this message
ID: 16342 Updated by: shiflett@php.net Reported By: myaddress@iname.com -Status: Open +Status: Feedback Bug Type: HTTP related Operating System: cookies and domain PHP Version: 4.1.1 New Comment: Try this: setcookie("test_cookie", "test$exp", $exp, "/", ".domain.com"); Also, don't forget that you can just write your own header with the header() function. If, for some reason, there *is* a problem with setcookie(), you can always just write your own to be sure. If my above example doesn't fix the problem, please try to give me the HTTP traffic, specifically the response. If you're unsure how to do this, feel free to email me personally. Hope that helps. Chris Previous Comments: ------------------------------------------------------------------------ [2002-03-29 07:36:06] myaddress@iname.com If I specify a domain, cookie is not set: This works: $exp = time()+120; setcookie ("TestCookie", "TEST$exp",$exp); This doesn't work: $exp = time()+120; setcookie ("TestCookie", "TEST$exp",$exp, "/", "www.domain.com"); Doesn't set a cookie at all. Any ideas? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16342&edit=1

« previous php.bugs (#4926) next »