Justtechjobs.com Find a programming school near you






Online Campus Both


php-developer-list | 2001041

[PHP-DEV] Bug #10282: session_set_cookie_params(time()) is setting wrong time From: tobias.fritz <email protected>
Date: 04/11/01

From: tobias.fritz <email protected>
Operating system: Red Hat Linux 7.0
PHP version: 4.0.4pl1
PHP Bug Type: *Session related
Bug description: session_set_cookie_params(time()) is setting wrong time

I wrote the following small script :

<?php
$user = "libo";
session_set_cookie_params(time());
session_register ("user");
setcookie ("TestCookie", "lalala", time());
?>

if I do a telnet to port 80 on the machine where the script is save I get the following result:

GET /tests/test.php HTTP/1.1
Host: lala

HTTP/1.1 200 OK
Date: Wed, 11 Apr 2001 09:58:21 GMT
Server: Apache/1.3.14 (Unix) mod_mp3/0.6 tomcat/1.0 PHP/4.0.4pl1 mod_ssl/2.7.1 OpenSSL/0.9.6
X-Powered-By: PHP/4.0.4pl1
Set-Cookie: PHPSESSID=82b5fe22428248792d7500dd051a76b6; expires=Tue, 20-Jul-32 19:56:52 GMT; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: TestCookie=lalala; expires=Wed, 11-Apr-01 09:58:26 GMT
Transfer-Encoding: chunked
Content-Type: text/html

like you can see, the setcookie ("TestCookie", "lalala", time()); is setting the right time while session_set_cookie_params(time()); is setting a really strange time ...

-- 
Edit Bug report at: http://bugs.php.net/?id=10282&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>