My replies are the below
1)Yes same website.
2)I am using Firefox version 3.5.9 - Do I need to enable cookies manually in this browser?
My replies are the below
1)Yes same website.
2)I am using Firefox version 3.5.9 - Do I need to enable cookies manually in this browser?
No it should be enabled automatically (and really shouldnt matter anyway, really).
Unless somewhere in your script you’re destroying the session, or page2 is in a directory at a higher level than page1, i cant explain this other than ‘php is misconfigured’… so at this point i’m going to call on the more skilled to come up with an answer i havent thought of.
This is what you’re testing with and it’s all of it?
As mentioned before, you are starting OB but not flushing. Try it without the OB
I have tested without OB but it doesn’t make any difference. Many thanks.
Anyone has any idea? Thanks anyway…
OK, just to be clear. You have
file1.php
<?php
session_start();
$_SESSION['value1'] = 'testing';
echo $_SESSION['value1'];
?>
file2.php
</php
session_start();
echo $_SESSION['value1'];
?>
If you go to file1.php you see “testing” but when you go to file2.php you don’t?
Try changing the files to
file1.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
session_start();
$_SESSION['value1'] = 'testing';
echo $_SESSION['value1'];
?>
file2.php
</php
error_reporting(E_ALL);
ini_set('display_errors', true);
session_start();
echo $_SESSION['value1'];
?>
and see if you get any error messages. If you have cookies disabled, try it with them enabled.
Showing following in page2
Notice: Undefined index: value1 in.....
In page1.php can you add these piece of HTML code and try
<a href="./page2.php">go page2</a>
I have already tried this…nothing changes…
If you try
file1.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
session_start();
$_SESSION['value1'] = 'testing';
echo '<pre>';
var_dump($_SESSION);
echo '</pre'>;
?>
file2.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
session_start();
echo '<pre>';
var_dump($_SESSION);
echo '</pre'>;
?>
Is value1 there with a different value or not there at all?
If you use a different browser, same thing?
Well I’ve noticed one thing, though I dunno anything regarding this.
But your local value and master value are different for session.save_path.
While I’ve checked mine and here Mittineague too have posted his value. And both of them are same.
Might be it is not able to retrieve session value from the master or local path.
value1 is not there at all…When I use a different browser…same thing…Oh I forgot to tell you guys that I browsing this over a secure connection…Thanks.
I don’t think sessions differ between http and https. And I don’t know which takes precedence, Local or Master. But it seems that there’s a good chance that
session.save_path
Local value: /var/www/vhosts/mydomain.com/httpdocs/tmp/
Master value: /var/lib/php/session
could be the reason for this mysterious behavior.
I don’t know if one’s better than the other, but I’m guessing they should be the same.
The problem was there before I changed the session.save_path
Local value to the above value…Thanks
Anyone has any other idea? Thanks again.
Please answer these:
value1 is not there at all…When I use a different browser…same thing…Thanks Mittineague.
Thanks for checking. That makes it less likely that it’s a browser issue.
I’m sorry I can’t do more than throw trouble-shooting ideas at you, but maybe if you changed your config to
session.use_trans_sid 1 1
it would work? The SESSION would show in the address bar, so it’s probably not something you will want to keep, but it should help narrow things down a bit more.
EDIT: Did the var_dump show PHPSESSID at least?
No it doesn’t show PHPSESSID. Do I need to change the session.use_trans_sid value? Thanks.
It’s getting late here where I am (on towards 3AM), but if no one comes up with a solution by tomorrow I’ll study into it some more and post back.
Meanwhile, please try the use_trans_sid 1 1 - restart, and see if that makes a difference.