php - 如何让我的会话 ID 正常工作
问题描述
if (mysqli_num_rows($result) == 1) {
$_SESSION['id'] = $id;
$_SESSION['success'] = "You are now logged in";
header('location: index.php');
}else {
array_push($errors, "Wrong username/password combination");
}
}
帮助我如何回显我的会话是否正常以及我的会话如何工作。
解决方案
switch (session_status())
{
case PHP_SESSION_NONE|1: echo 'NONE';
session_start ([$_SESSION['id'] = 25, $_SESSION['success'] = "You are now logged in"]);
break;
case PHP_SESSION_ACTIVE|2: echo 'ACTIVE';
if(isset(~)) {~}
break;
}
推荐阅读
- firefox - FF 57.0 - 转化率比其他版本低 100 倍但不为空
- ios - 在 MVVM 中绑定而不触发
- fullcalendar - 如何添加带有图标和文本的自定义按钮?
- mysql - 如何在 MySQL 8 的 JDBC 连接字符串中设置 SQL 模式?
- postgresql - 我们可以在 Pgadmin 4 中附加调试器吗
- html - 网页在本地看起来正确,但在 IIS (Internet Explorer 11) 上不正确
- android - 设备空闲时的地理位置
- mysql - 使用 Express 和 Node.js 将记录插入 MySQL 的问题
- c++ - Assembly x86 convert to ARM function call with varying number of parameters to Arm
- excel - 使用单元格内容打开文件