Home > Article > Backend Development > How to modify session_id in php
How to modify session_id in php: 1. Create a PHP sample file; 2. Add "if(isset($_GET["se"])){...}"; 3. Pass "session_id( $se);" Just set the session_id of the $se bit.
#The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.
How to modify session_id in PHP?
Sample code for modifying session_id in PHP
The following is the detailed code for modifying session_id in PHP. I hope it will be helpful to everyone
The code is as follows:
if(isset($_GET["se"])){ $se = $_GET["se"]; }else{ return; } if(!empty($se)){ echo("receive se: ".$se."</br></br>"); //接受的的session为$se session_id($se); //设置$se位session_id session_start(); //开启sesseion ,注意不能与上一步对调,打工告成 echo("new session id: ".session_id()."</br></br>"); echo $_SESSION['h']; }
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to modify session_id in php. For more information, please follow other related articles on the PHP Chinese website!