session_id什么意思

PHPz
Release: 2020-09-05 13:32:24
Original
9001 people have browsed it

“session_id”是php中的函数,是用于取得或者重新配置目前存放Session的代号,其语法是“string session_id(string [id]);”。

session_id什么意思

session_id什么意思?

session_id()

session_id() 存取目前 session 代号。

语法: string session_id(string [id]);

本函数可取得或者重新配置目前存放 Session 的代号。若无参数 id 则表示只有取得目前 Session 的代号,加上参数则表示将 Session 代号设成新指定的 id。输入及返回均为字符串。

输出 session_id()

<?php
session_start();
echo session_id();
// 输出 dqr58dnuqj2gufvg4o3tmjb9v4
?>
Copy after login

设置 session_id()

<?php
session_id("NowaMagic");
session_start();
echo session_id();
// 输出 NowaMagic
?>
Copy after login
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!