0
我在我的文件中有發佈者php get in index.php消息 Warning:session_start():無法發送會話緩存限制器 - 已經發送的頭文件(輸出開始於/ Users/[用戶名在/Users/[username]/Sites/application/Core/session.php在線20class session Warning session_start()in php 5.4
<?php
// A class to help work with Sessions
// In our case, primarily to manage logging users in and out
// Keep in mind when working with sessions that it is generally
// inadvisable to store DB-related objects in sessions
require_once('includes/initialize.php');
class Session{
private $logged_in=false;
public $id;
function __construct() {
//@ob_start();
session_start();
$this->check_login();
if($this->logged_in) {
}else{
}
}
public function is_logged_in() {
return $this->logged_in;
}
public function login($username) {
// database should find user based on username/password
if($username){
$this->id = $_SESSION['id'] = $username->id;
$this->logged_in = true;
}
}
public function logout() {
unset($_SESSION['id']);
unset($this->id);
$this->logged_in = false;
}
private function check_login() {
if(isset($_SESSION['id'])) {
$this->id = $_SESSION['id'];
$this->logged_in = true;
} else {
unset($this->id);
$this->logged_in = false;
}
}
}
$session = new Session();
?>
檢查'/用戶/ [用戶名] /Sites/application/Core/users.php:3'它迴應什麼?即使是''以外的空白也被認爲是輸出 – bansi 2014-09-04 16:26:37