#37653 [NEW]: Cookie Accessing..
| From: | werty37 at gmail dot com | Date: | Wed, 31 May 2006 15:16:45 +0000 |
| Subject: | #37653 [NEW]: Cookie Accessing.. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-97861@lists.php.net to get a copy of this message | ||
From: werty37 at gmail dot com
Operating system: Linux 2.6.15.23 (Ubuntu Dapper)
PHP version: 5.1.4
PHP Bug Type: Output Control
Bug description: Cookie Accessing..
Description:
------------
Hi
I think there is some problem with cookie accessing.
I am using PHP Version 5.1.2, Apache 2.
The first time i request the web page, i
get the message "Cookies are disabled". On the second request and subquent
requests, the script prints the cookie content.
I know that if a cookie is set in a given script, it wont be set on the
client until that page (and its HTTP headers) are sent off to the client.
But in my script im explicitly flushing the headers.
Please correct me if i am wrong.
Reproduce code:
---------------
<?php ob_start('ob_gzhandler');
if (!isset($_COOKIE['RESULTS']))
{
session_name('RESULTS');
session_set_cookie_params(3600, "/", "", 0);
session_start();
}
ob_flush();
?>
<?php
if (!isset($_COOKIE['RESULTS'])) { die("Cookies are disabled");} else
{echo $_COOKIE['RESULTS'];}
?>
Expected result:
----------------
if cookies are enabled by the user, on first request
it should print the cookie content.
if cookies are disabled, it should print "Cookies
are disabled"
--
Edit bug report at http://bugs.php.net/?id=37653&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37653&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37653&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37653&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37653&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37653&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37653&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37653&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37653&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37653&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37653&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37653&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37653&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37653&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37653&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37653&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37653&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37653&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37653&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37653&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37653&r=mysqlcfg