Solution to the problem of PHP Session loss: Add [session_id(SID);] before [session_start();], the code is [session_id(SID);session_start();$_SESSION['test' ]=””].
Solution to PHP Session loss problem:
Solution to session loss situation
In session_start (); add session_id(SID) before;
<?php /* *session1.php */ session_id(SID); session_start(); $_SESSION['test']="HelloWorld!"; header("location:session2.php"); ?><?php
/* *session2.php */ session_id(SID); session_start(); echo$_SESSION['test']; ?>
If you want to learn more about programming, please pay attentionphp trainingColumn!
The above is the detailed content of PHP Session loss problem. For more information, please follow other related articles on the PHP Chinese website!