Home >Backend Development >PHP Tutorial >PHP View the ID instance of the current Session, the current sessionid instance_PHP tutorial

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

WBOY
WBOYOriginal
2016-07-13 10:03:321107browse

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;>

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...
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