From: ateo at skepticshour dot com
Operating system: Gentoo Linux
PHP version: 4.3.3
PHP Bug Type: Session related
Bug description: setcookie not accepting expire parameter
Description:
------------
setcookie not accepting the expire parameter no matter how I configure it.
ie:
setcookie("user","$info",time()+30000);
OR
$ntime = time();
setcookie("user","$info",$ntime()+30000);
OR
$expire = time() + 300000;
setcookie("user","$info",$expire);
In each one of the above examples, the cookie IS set, but ends with
session.
Compile time information:
'./configure' '--prefix=/usr' '--host=i686-pc-linux-gnu'
'--mandir=/usr/share/man' '--infodir=/usr/share/info'
'--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib'
'--without-readline' '--with-apxs2=/usr/sbin/apxs2' '--with-ndbm'
'--with-db4=/usr' '--with-mcrypt=/usr' '--with-mhash' '--with-ming=/usr'
'--with-swf=/usr' '--with-gdbm=/usr'
'--with-java=/opt/blackdown-jdk-1.4.1' '--without-pgsql' '--with-snmp'
'--enable-ucd-snmp-hack' '--with-xpm-dir=/usr/X11R6' '--with-pdflib=/usr'
'--with-gd' '--enable-gd-native-ttf' '--with-png-dir=/usr' '--with-jpeg'
'--with-jpeg-dir=/usr' '--enable-exif' '--with-tiff-dir=/usr'
'--with-mysql=/usr' '--with-mysql-sock=/var/run/mysqld/mysqld.sock'
'--with-freetype-dir=/usr' '--with-gettext' '--with-qtdom' '--with-pspell'
'--with-openssl' '--with-imap' '--without-ldap' '--with-dom'
'--with-dom-xslt' '--with-dom-exslt' '--without-kerberos' '--with-pam'
'--disable-memory-limit' '--enable-ipv6' '--with-curlwrappers'
'--with-curl' '--enable-dbx' '--with-imap-ssl' '--with-zlib'
'--with-zlib-dir=/usr/lib' '--with-sablot=/usr' '--enable-xslt'
'--with-xslt-sablot' '--with-xmlrpc' '--enable-wddx' '--with-xml'
'--enable-mbstring=all' '--enable-mbregex' '--with-bz2' '--with-crack'
'--with-cdb' '--enable-bcmath' '--enable-calendar' '--enable-dbase'
'--enable-filepro' '--enable-ftp' '--with-mime-magic' '--enable-sockets'
'--enable-sysvsem' '--enable-sysvshm' '--enable-sysvipc' '--with-iconv'
'--enable-shmop' '--enable-dio' '--enable-inline-optimization'
'--enable-track-vars' '--enable-trans-sid' '--enable-versioning'
'--with-config-file-path=/etc/php/apache2-php4'
Reproduce code:
---------------
setcookie("user","$info",time()+30000);
Expected result:
----------------
a cookie named "user" with information "$info" set to the remote
computer's hard drive and set to expire in 30,000 seconds after cookie is
written to hard drive.
Actual result:
--------------
Cookie is written into memory that expires at the end of session.
--
Edit bug report at http://bugs.php.net/?id=26146&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26146&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26146&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26146&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26146&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26146&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=26146&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26146&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26146&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26146&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26146&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26146&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26146&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26146&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26146&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26146&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26146&r=float