php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26146 setcookie not accepting expire parameter
Submitted: 2003-11-05 21:31 UTC Modified: 2003-11-05 22:52 UTC
Votes:1
Avg. Score:2.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: ateo at skepticshour dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.3 OS: Gentoo Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ateo at skepticshour dot com
New email:
PHP Version: OS:

 

 [2003-11-05 21:31 UTC] ateo at skepticshour dot com
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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-05 21:59 UTC] ateo at skepticshour dot com
please close bug report. I found the issue. It was a userside issue.
 [2003-11-05 22:52 UTC] sniper@php.net
User error -> bogus.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Sep 12 00:01:27 2024 UTC