php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25465 Session lost, session.cookie.lifetime
Submitted: 2003-09-10 03:10 UTC Modified: 2003-09-10 09:04 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sam dot houlder at teleperfomance dot no Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.3 OS: Linux
Private report: No CVE-ID: None
 [2003-09-10 03:10 UTC] sam dot houlder at teleperfomance dot no
Description:
------------
Client looses session cookie if client time + cookie lifetime > server time.

Does cookie get timestamp from server? 



Reproduce code:
---------------
File1 :
<?php
ini_set('session.cookie_lifetime', '60');

session_start();

$_SESSION[counter]=$_SESSION[counter]+1;
$_SESSION[s_logon]='Logged in';
echo "<META HTTP-EQUIV=Refresh CONTENT=\"3; URL=file2.php\">";

echo "This is file1.php<br>";
echo "Session logon: $_SESSION[logon]<br>";
?>

File2:
<?php
session_start();
echo "<META HTTP-EQUIV=Refresh CONTENT=\"3; URL=file1.php\">";
echo "This is file2.php<br>";
echo "Session logon: $_SESSION[s_logon]<br>";
unset($_SESSION[s_logon]);

?>

Expected result:
----------------
If script file1.php i started, $_SESSION[logon] will display in file 2, IF client time + session.cookie.lifetime < server time.

I would have expected the cookie timestamp to origin from client time and not server time.



Actual result:
--------------
if client time+cookie.lifetime<server time
fil1.php:

fil2.php:
This is file2.php
Session logon: Logged in

if client time+cookie.lifetime>server time

fil1.php:
This is file1.php
Session logon: 

file2.php:
This is file2.php
Session logon: 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-10 03:11 UTC] sam dot houlder at teleperfomance dot no
Corrected file1.php
remove $_SESSION[counter] ...
 [2003-09-10 09:04 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Support questions elsewhere, there is not bug here.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 27 14:00:03 2025 UTC