我想知道如何讓PHP會話超時?我有這個迄今爲止,或使其所以人們可以用餅乾和登錄..Php會話超時安全
<?php
include('config.php');
session_start();
$user_check=$_SESSION['login_user'];
$ses_sql=mysql_query("select username from admin where username='$user_check' ");
$row=mysql_fetch_array($ses_sql);
$login_session=$row['username'];
if(!isset($login_session))
{
header("Location: login.php");
}
?>
http://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes檢查出來,應該回答你的問題。 – Kaylined