I'm trying to use this little sample script (in two ways) on my server but it doesn't want to work. My question is very simple: Why?:-)
Here is the one:
Code: Select all
<?php
// index.php
session_start();
$my_session_variable = "some value";
session_register("my_session_variable");
print "<a href=index2.php>Click me</a>";
?>
<?php
//index2.php
session_start();
print "Value of 'my_session_variable': $my_session_variable";
?>Code: Select all
<?php
// index.php
session_start();
$_SESSIONї'my_session_variable']="some value";
print "<a href=index2.php>Click me</a>";
?>
<?php
//index2.php
session_start();
print "Value of 'my_session_variable':".$_SESSIONї'my_session_variable'];
?>I took a look into session save path, the session file was created well and contains the correct data:
my_session_variable|s:10:"some value";
I also have tried call the script above this way:
index2.php?PHPSESSID=sessionid
or setting session.use_trans_sid to 1
and in both cases it worked fine, but if i call this file without the sessid string it doesn't work...
So, what should i do to get session based scripts work having the setting above disabled and not using sessid string in url?
Here are a few settings from my php.ini file:
(but i have tried to change these from 1 to 0)
session.use_cookies = 1
session.use_only_cookies = 1
BTW, my configuration is: Win XP, PHP v 4.3.1, Apache v 1.3.27.
Any help would be greatly appreciated!
Dedix