PHP5 session variable lost
Hi,
I am having a problem passing session variable to the next page.
I am using PHP5.2, MySQL, and Apache 2.2 on Windows XP.
I read many forums and tried different/suggested solutions without success! I would appreciate your help with this.
In page1 I am using the simple code outline below:
<?PHP
session_start();
$color="green";
$_SESSION['color'] = $color;
?>
On page2 I used:
<?php
session_start();
echo "Color = ". $_POST['color']
echo "<br>Color =" . $_SESSION['color'];
?>
However, nothing gets displayed in page2!
Several posts suggest the problem could be in the PHP.ini file.
Here's related parts of my php.ini file:
;session.save_path = "50;/W:\Apache2.2\PHP\sessions\"
session.save_path = "W:\Apache2.2\PHP\sessions\"
session.use_only_cookies = 1
;session.save_path = "/tmp"
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = "W:\Apache2.2\PHP\sessions\"
I am not a PHP expert, and I would really appreciate your help with this.
Many thanks
Totti
|