From:             steven dot harrison3 at ntlworld dot com
Operating system: windows xp pro
PHP version:      Irrelevant
PHP Bug Type:     Session related
Bug description:  $_SESSION problem - values not being passed

Description:
------------
I’m using EasyPHP1-7 from http://www.easyphp.org/ (this has php 4.3.3,
apache server 1.3.27 and MySql but I’m using a Firbird database for this
project).
I have a windows xp professional operating system(with service pack 2) and
am trying to develop a php website on my local machine.

I have changed the Php.ini file to : 
•       session.save_path = C:\EasyPHP1-7\temp\ to enable session variables.
•       php_interbase.dll enabled in easyPHP to connect to Firebird database.


Now my problem is that the $_SESSION superglobals are not keeping their
value to the next page.
•       I’ve looked in the C:\EasyPHP1-7\temp\ folder and it seems to create two
files – one with the information from the first php page then a new one
with nothing in it for the second page, therefore losing the value I want.

•       Now I know that session start() will create a new session if an existing
one does not exist, .
•       I have checked my php info and session variables are enabled, I’ve even
created a privay policy header to see if this was the problem. (found at
www.privacycouncil.com )

Has anyone any ideas as I’ve inherited this site as a final year project
and it uses these superglobals a lot for database connection and user
logins and the university won’t host session variables through php.


I've included an incredibly simple php page that won't work but should.
Any suggestions would be gratefully accepted as I'm a newby to these
session variables.



Reproduce code:
---------------
//1st php page:
<?php
Header("P3P:CP='NON CUR OUR IND UNI STA OTC'")
?>
<?php

session_start();
?>
<html>
<head>
<title> Starting or resuming a session</title>
</head>
<body>
<?php
echo "<p> Your session ID is ".session_id()."</p>";


 
$_SESSION[product1] = "sonic screwdriver";
echo "The products have been registered ";
echo $_SESSION[product1];
echo "<br>";
echo session_save_path();

?>
<p>&nbsp;</p>
<p><a href="/_mmServerScripts/session3.php">session3</a></p>
</body>
</html>

//second page
<?php
Header("P3P:CP='NON CUR OUR IND UNI STA OTC'")
?>

<?php

if (!session_id())
{
  session_start();
}

?>
<html>
<head>
<title> Starting or resuming a session</title>
</head>
<body>
<?php
echo "<p> Your session ID is ".session_id()."</p>";

$product = $_SESSION[product1];
echo "your chosen product is: ";
echo "<br>";
echo "$product";
echo "<br>";
echo "humph!";

?>
</body>
</html>


Expected result:
----------------
your chosen product is:
sonic screwdriver
humph!

Actual result:
--------------
your chosen product is:

humph!

-- 
Edit bug report at http://bugs.php.net/?id=30880&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30880&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=30880&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=30880&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30880&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30880&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30880&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30880&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30880&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30880&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30880&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=30880&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=30880&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30880&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30880&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30880&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30880&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30880&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30880&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30880&r=mysqlcfg

Reply via email to