首页 > 解决方案 > 如何让我的会话 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");
    }
  }

帮助我如何回显我的会话是否正常以及我的会话如何工作。

标签: phpsqlsession

解决方案


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

推荐阅读