How to accept cookie from iPhone, login page

℡╲_俬逩灬. 提交于 2019-12-02 08:04:42

问题


I don't know what is wrong with this php script but it makes the remember log-in for the device iPhone stop working (will log out every time when refresh the page) but the other device such as iPad, and all the PCs still can use remember me function still.

<?php
if(!isset($_GET['link'])){ 
    $link = 1; 
} else { 
    $link = $_GET['link']; 
}

if ($link == 1) {
echo "";
} elseif ($link == 23) {
echo "";
} else {
echo "";
} 
?>

so every single time the device refresh it will redirect to the login page again

but then if I remove this script then it will remember the login

any help will be appreciated


回答1:


Use session_set_cookie_params on the header:

session_set_cookie_params(2*7*24*60*60);


来源:https://stackoverflow.com/questions/6169066/how-to-accept-cookie-from-iphone-login-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!