ID: 10282
Updated by: sas
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: *Session related
PHP Version: 4.0.4pl1
Assigned To: 
Comments:

The first parameter is relative to the current time. Hence, common applications use an 
absolute value like 3600 there, so that the cookie exists for a specific amount of 
time.

Previous Comments:
---------------------------------------------------------------------------

[2001-04-11 06:07:52] [EMAIL PROTECTED]
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 ...

---------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10282&edit=2


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to