Home > Article > Backend Development > Regarding SESSION, I want to say one more thing. _PHP Tutorial
Under WIN32, I don’t know why PHP4 always has problems processing absolute paths. This is mainly reflected in the settings of extension_dir, upload_tmp_dir and session.save_path. No matter how you set them, it doesn't work. Then I set it to ./, so it all worked.
But the problem comes again. The path session.save_path corresponds to the currently executed PHP file. Therefore, when you use SESSION, if you change to another directory, the SESSION will be gone.
Of course these do not exist under LINUX. Because under LINUX, you can use /tmp.
So regarding this brother’s question, I think it can be like this. First, look at your PHP. The content of INI, session.save_path should be changed to ./. Then, your program also has some problems, I added some comments. You can try again.
session_register("abc"); //You should assign values to variables first, and then execute some functions
$abc="abcdefg"; //That is to say, this sentence should be placed at the front.
header("Location: go.php");
?>
//////////////////////////// ///////////////
//go.php
session_register("abc"); //This sentence is unnecessary.
echo "You are ".$abc."
";
?>