Budi Santoso
asked on
Problem with session_register
I creating session variable with this code :
<?php
session_register("var_x");
$var_x = "123456";
print(" session_id() . "<BR>\n");
print("Session variable is : $var_x");
?>
I get nothing when read that variable with this code :
<?php
session_start();
print("SID : " . session_id() . "<BR>\n");
print("Session variabel is : <BR>\n");
print($var_x);
?>
SID is appear but print($var_x) doesn't print anything, What's wrong ?
Thanks.
<?php
session_register("var_x");
$var_x = "123456";
print(" session_id() . "<BR>\n");
print("Session variable is : $var_x");
?>
I get nothing when read that variable with this code :
<?php
session_start();
print("SID : " . session_id() . "<BR>\n");
print("Session variabel is : <BR>\n");
print($var_x);
?>
SID is appear but print($var_x) doesn't print anything, What's wrong ?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I had fix it myself.
The problem is in php.ini
session.save path still "/tmp"
Then I change to my local drive.
Anyway, thanks for the information.
The problem is in php.ini
session.save path still "/tmp"
Then I change to my local drive.
Anyway, thanks for the information.
<?php
session_start();
session_register("var_x");
$_SESSION["var_x"] = "123456";