PHP View the ID instance of the current Session, the current sessionid instance_PHP tutorial

WBOY
Release: 2016-07-13 10:03:32
Original
1080 people have browsed it

php checks the ID instance of the current Session, the current sessionid instance

The example in this article describes the method of checking the ID of the current Session in php. Share it with everyone for your reference. The details are as follows:

There are two ways to get the user's session id. The first is to use the session_id() function, and the other is to use the built-in constant SID. SID contains the session id and session value

<&#63;php
 session_start();
 print("<html><b>");
 $sid = session_id();
 print("Session ID returned by session_id(): ".$sid."\n");
 $sid = SID;
 print("Session ID returned by SID: ".$sid."\n");
 $mysite = $_SESSION["mysite"];
 print("Value of mysite has been retrieved: ".$mysite."\n");
 print("</b></html>\n");
&#63;>
Copy after login

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/968260.htmlTechArticlephp checks the ID instance of the current Session, the current sessionid instance. This example describes the method of checking the ID of the current Session in php. Share it with everyone for your reference. The details are as follows: There are two methods...
Related labels:
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