Home >Backend Development >PHP Tutorial >PHP client disables cookies and how to use session_PHP tutorial

PHP client disables cookies and how to use session_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:54:10806browse

First way: add a PHPSESSID=$sid on each hyperlink

//Prevent returning to the initial page to generate a new session
if(isset($_GET["PHPSESSID"])){
Session_id($_GET["PHPSESSID"]);
}
//Start a session
session_start();
//Get the session_id()
of the current session $sid=session_id();
//Add parameter PHPSESSID=$sid

on each link

How to obtain other pages:
if(isset($_GET["PHPSESSID"])){
//Set the current session as the initial session, and the session_id() is consistent
Session_id($_GET["PHPSESSID"])
}
session_start();

Second way: Use SID constant to replace PHPSESSID=$sid on the link (SID value is similar: PHPSESSID=sddg34r593dfdlksrewr)
if(isset($_GET["PHPSESSID"])){
Session_id($_GET["PHPSESSID"]);
}
//Start a session
session_start();


How to get other pages:
if(isset($_GET["PHPSESSID"])){
//Set the current session as the initial session, and the session_id() is consistent
Session_id($_GET["PHPSESSID"])
}
session_start();

The third way: use session.use_trans_sid=1, configure in php.ini
This method will automatically add SID (href, location, action, note: js jump will not add SID) to the url

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477983.htmlTechArticleThe first way: add a PHPSESSID=$sid to each hyperlink //Prevent returning to the initial page New session if(isset($_GET[PHPSESSID])){ session_id($_GET[PHPSESSID]); } //Start a...
Statement:
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