如何使我的会话ID工作

时间:2018-07-23 10:11:56

标签: php sql session

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

请帮助我,我该如何回应我的会话是否正常工作以及会话如何工作。

1 个答案:

答案 0 :(得分:-3)

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