Deprecated: Function session_is_registered() is deprecated in /home/socia125/public_html/logout.php on line 37不推薦使用:功能session_is_registered() - 如何解決這個錯誤
Warning: Cannot modify header information - headers already sent by (output started at /home/socia125/public_html/logout.php:37) in /home/socia125/public_html/logout.php on line 38
這裏的任何想法是代碼我使用
<?php
session_start();
// Force script errors and warnings to show on page in case php.ini file is set to not
display then
error_reporting(E_ALL);
ini_set('display_errors', '1');
// Unset all of the session variables
$_SESSION = array();
// If it's desired to kill the session, also delete the session cookie
if (isset($_COOKIE['idCookie'])) {
setcookie("idCookie", '', time()-42000, '/');
setcookie("passCookie", '', time()-42000, '/');
}
// Destroy the session variables
session_destroy();
// Check to see if their session is in fact destroyed
if(!session_is_registered('firstname')){
header("location: index.php"); // << makes the script send them to any page we set
} else {
print "<h2>Could not log you out, sorry the system encountered an error.</h2>";
exit();
}
?>
這個問題是重複的。還有一個在這裏:http://stackoverflow.com/questions/2600905/php-alternative-to-session-is-registered – ceekays
感謝好友我看着它 –