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

From: Date: Wed, 12 Jun 2002 18:51:09 +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-10275@lists.php.net to get a copy of this message
ID: 16342 Updated by: shiflett@php.net Reported By: myaddress@iname.com -Status: Feedback +Status: Closed Bug Type: HTTP related Operating System: cookies and domain PHP Version: 4.1.1 New Comment: It's been 60 days without a response. Please reopen this bug if it still persists. Otherwise, I will assume my last comment resolved it for you. Previous Comments: ------------------------------------------------------------------------ [2002-04-13 18:52:50] shiflett@php.net 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 ------------------------------------------------------------------------ [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 (#10275) next »