0
以下是我的登錄PHP代碼。如何設置cookie以使瀏覽器保持用戶登錄6個月,即使他們關閉了瀏覽器?設置cookie以保持用戶登錄六個月
if (!isLoggedIn())
{
// user is not logged in.
if (isset($_POST['cmdlogin']))
{
// retrieve the username and password sent from login form & check the login.
if (checkLogin($_POST['username'], $_POST['password']))
{
show_userbox();
這裏我的評論,你做了什麼? –
$ inTwoMonths = 60 * 60 * 24 * 60 + time(); setcookie('cmdlogin','cmdlogin',$ inTwoMonths);並且它不起作用 – John