From: jansi_bosco at yahoo dot co dot in
Operating system: Linux
PHP version: 5.3.1
PHP Bug Type: Session related
Bug description: Session doesn't work in php5
Description:
------------
I am using php5 version. The script is doesn't work in php5. But its work
under php4 fine. What may be the problem occurs? I search the page in my
php info() file, The register_global is ON mode in Php4.
But in the php5 the register_global is OFF.
In my site, there are the scripts are didn't work well. The file redirect
to another page. But there is no data is retreived. The save_path also have
a no value. so I have created the sample page in my site whether the
session is work or not. But in my server side the session is not working
well. I checked the php info file the register global is off
Given below the example was I used. Its not working under php5.
Reproduce code:
---------------
//session1.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<?php
session_start('mysession');
class Cus{
var $cusid;
function newCus($cusid, $index){
$this->cusid[$index] = $cusid;
}
function getCus(&$tmparray){
for($i = 0; $i < count($this->cusid); $i++){
$tmparray[$i] = $this->cusid[$i];
}
}
}
$customer = new Cus();
$customer->newCus("Cliente 1",0);
$_SESSION['customer'] = $customer;
echo "<a href=\"./session2.php\">Página 2 de la sesión</a><br>";
print_r($_SESSION);
?>
</body>
</html>
---------------------------------------------------------------------
//session2.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<?php
session_start();
class Cus{
var $cusid;
function newCus($cusid, $index){
$this->cusid[$index] = $cusid;
}
function getCus(&$tmparray){
for($i = 0; $i < count($this->cusid); $i++){
$tmparray[$i] = $this->cusid[$i];
}
}
}
$_SESSION['customer']->getCus($tmparr);
print_r($tmparr);
session_unset();
session_destroy();
?>
</body>
</html>
--
Edit bug report at http://bugs.php.net/?id=50602&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50602&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50602&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50602&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50602&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50602&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50602&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50602&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50602&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50602&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50602&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50602&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50602&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50602&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50602&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50602&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50602&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50602&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50602&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50602&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50602&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50602&r=mysqlcfg