首页 > 解决方案 > 通过 session_start() 建立新会话后,如何消除虚拟包含语句上的警告消息?

问题描述

问题及说明:

我不太熟悉如何使用虚拟包含正确启动会话,我正在尝试为用户创建欢迎页面,但我一直在我的一个virtual(...)声明中收到警告。我将在下面列出错误。我确信它不会很难修复,但我似乎无法摆脱它。

代码

<?php session_start(); ?>
<!DOCTYPE html>
<html>
//line below is where I get the error
<?php virtual('../common/headerhw8.html'); ?>
<body>
<?php
echo'Welcome to user welcome page';
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
    header("location: ../php/login.php");
    exit();
}
?>
</body>
</html>

错误

virtual(): A session is active. You cannot change the session module's ini settings at this time

标签: phpsession-cookies

解决方案


推荐阅读