Home > Backend Development > PHP Problem > How to modify session_id in php

How to modify session_id in php

藏色散人
Release: 2023-03-12 19:26:02
Original
2639 people have browsed it

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.

How to modify session_id in php

#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[&#39;h&#39;];
}
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template