Learn how to transfer PHPsession, phpsession. I learned how to transfer PHPsession. This article will share with you the three methods of transferring phpsession for your reference. take a note as follows, learning the PHP session transmission method, phpsession
The example in this article shares three transfer methods of PHP session for your reference. The details are as follows:
Now that you have learned how to take notes and solve data sharing, don't worry about it. When should you manually set the cookie to be opened!
(1) pass session_id through GET
<? Php $ sid = "test"; // Set the idsession_id ($ sid) of a session; // The value of $ sid is treated as session_id, which is convenient for testing session_start (); // enable session $ _ SESSION ['user'] = "session transfer method";?> "> Test_1.php // process the effect of modifying different configuration items in the configuration file of php by passing the session_id value through GET. use_only_cookies = // disable this option, that is, you can use get to automatically generate a session "> test_1.php //. you can save yourself from getting a session value through $ _ GET. use_trans_sid = 1 // enable this option. session_idtest_2.php is automatically used. // no parameter is required, ========================================================== ========== "> test_1.php, which is a bit forgotten? SID is a constant, contains the required session information! // Session_3.php page session_id ($ _ GET ['Sid ']); // accept sesssion_id; session_start (); var_dump ($ _ SESSION); // view the printed result
Result
(2) pass the hidden values in the form
// The previous public part remains unchanged // pass it through form hiding/$ sid =$ _ POST ['Sid ']; session_id ($ sid ); session_start (); var_dump ($ _ SESSION); // print the result and check that all results are the same, so that no repeated input results are returned.
(3) file format
The above is all the content in this article. I hope you can learn more about the transfer method of PHP session.
In this article, we will share with you three methods of transferring PHP sessions for your reference. The details are as follows ,...