<?php
session_start();
$_SESSION['name'] = 'jobs';
//在这里删除name的session值
unset($_SESSION['name']);
if (isset($_SESSION['name'])) {
echo $_SESSION['name'];
}
session_start();
$_SESSION['name'] = 'jobs';
//在这里删除name的session值
unset($_SESSION['name']);
if (isset($_SESSION['name'])) {
echo $_SESSION['name'];
}
2017-08-09
<?php
//在这里设置name的session值为jobs
session_start();
$_SESSION['name'] = "jobs";
echo $_SESSION['name'];
//在这里设置name的session值为jobs
session_start();
$_SESSION['name'] = "jobs";
echo $_SESSION['name'];
2017-08-09
<?php
//补充路径参数,实现有效路径的设置
setcookie('test', '1', 0, '/path');
var_dump($_COOKIE['test']);
//补充路径参数,实现有效路径的设置
setcookie('test', '1', 0, '/path');
var_dump($_COOKIE['test']);
2017-08-09
<?php
$value = time();
//在这里设置一个名为test的Cookie
setcookie("test", $value);
if (isset($_COOKIE['test'])) {
echo 'success';
}
$value = time();
//在这里设置一个名为test的Cookie
setcookie("test", $value);
if (isset($_COOKIE['test'])) {
echo 'success';
}
2017-08-09