php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15317 setcookie() does not work with CGI PHP
Submitted: 2002-01-31 14:04 UTC Modified: 2002-06-04 09:00 UTC
Votes:4
Avg. Score:4.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:2 (50.0%)
From: bmatzelle at yahoo dot com Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.1.1 OS: Windows 2000 SP2
Private report: No CVE-ID: None
 [2002-01-31 14:04 UTC] bmatzelle at yahoo dot com
When I use the IIS CGI version on Windows the setcookie() function does not set the cookie.  The $HTTP_COOKIE_VARS and $_COOKIE arrays are both totally empty.  However, it does work with the (very unstable) ISAPI version and always works on Apache no matter the OS.  

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-04 16:35 UTC] krane at adm dot njit dot edu
Experiencing the same problem.  If the cookies are set using setcookie() on a *nix box, they can successfully be read using PHP/ASP running on Windows or *nix.  However, cookies set with PHP using setcookie() on Windows cannot be read by *either* ASP or PHP running on *either* Windows or *nix.  Since it's not triggering IE's cookie protection nor lynx's it's a safe assumption that maybe setcookie() just doesnt work on Windows.
 [2002-04-22 13:46 UTC] ftouanen at yahoo dot fr
Concerning cookies, check this usefull test to determine what "cookie method" is working in your environment.

http://www.chipchapin.com/WebTools/cookietest.php?
source=true

I'm using PHP 4.11 under WNT 4 SP5, WNT 2K, WIN98 with Apache for WIN32.

Client are IE4, IE 5.5, IE6 and NS 6 under WIN95,WIN98,WIN2K. 

I got some problems by using a setcookie like :

setcookie("user","$info",time() + 15552000);

I changed in :

setcookie("user","$info","(time() + 15552000)");

and it's working fine now.

Hope that will help.
 [2002-05-16 16:10 UTC] JaM3z2000 at hotmail dot com
nope... doesn't work at my server... :(
 [2002-06-03 12:29 UTC] mfischer@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 [2002-06-04 09:00 UTC] bmatzelle at yahoo dot com
When this bug report was filed 4.1.1 was the latest version.  It is my understanding that the QA team should verify that the bug has been fixed rather than making the statement that "the problem might already be fixed".  At the very least since you are the one closing the bug report you should verify this.  Now this bug will continue to propogate.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC