使用PHP会话进行实验并显示cookie数组,但是在cookie中找到了_ga变量/值。哪个应用程序/谁在写我的Cookie?
我已经删除了代码。
$time = $_SERVER['REQUEST_TIME'];
echo "<PRE>";
echo session_id();
echo "<BR>cookie:<BR>";
print_r($_COOKIE);
echo "</PRE>";
if (isset($_SESSION['LAST_ACTIVITY'])){
echo "session last activity check<BR>";
$tt = $time - $_SESSION['LAST_ACTIVITY'];
echo "seconds passed : $tt<BR>";
if($tt> 60) {
echo "EXPIRED...";
session_unset();
session_destroy();
session_start();
$_SESSION['LAST_ACTIVITY'] = $time;
}
} else {
echo "expired altogether or it's been forever!<BR>";
$_SESSION['LAST_ACTIVITY'] = $time;
}
echo "<BR>time:" . date('Y-m-d h:i:s',$time);
我只希望PHPSESSID变量,但是输出显示了另一个变量_ga:
l7bbchk6ae51u53a89aanvvi5d
cookie:
Array
(
[_ga] => GA1.2.37759029.1552805943
[PHPSESSID] => l7bbchk6ae51u53a89aanvvi5d
)
session last activity check
seconds passed : 3
time:2019-04-17 02:39:12