我有一个以前有效的PHP会话,但现在它已不再适用了。我无法获取存储的会话数据。
会话创建(所有POSTS都基于来自表单的数据):
<?php
session_start();
include("db.php");
if (isset($_POST['submit']))
{
$alias = $_POST["username"] ;
$pass = mysqli_fetch_row(mysqli_query($con,"SELECT pass FROM table WHERE alias = '". $alias ."'"));
$password = $_POST["password"] ;
$enterpass = substr(hash('ripemd160', $password), 0,32);
if($enterpass == $pass[0]){
$_SESSION['loggedIn'] = true;
$_SESSION['user'] = $alias;
echo '<meta http-equiv="refresh" content="0;url=loggedin.php" />';
}
else{
echo '<meta http-equiv="refresh" content="0;url=index.php" />';
}
}
?>
检查会话是否处于活动状态:
if ($_SESSION['loggedIn'] == FALSE) {
echo '<meta http-equiv="refresh" content="0;url=index.php" />';
}
请帮我找出我的会话没有开始的原因。