php【基础学习六】会话



<?php
//setcookie('name','liaojianguo');
//?>
<!--<!DOCTYPE html>-->
<!--<html lang="en">-->
<!--<head>-->
<!--    <meta charset="UTF-8">-->
<!--    <title>Title</title>-->
<!--    <script>alert(document.cookie)</script>-->
<!--</head>-->
<!--<body>-->
<?php
//header('Location:show_session.php');
//?>
<!--</body>-->
<!--</html>-->


<?php

session_start();

$_SESSION['name'] = 'liaojianguo';

header('Location:show_session.php');
?>



<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2015/12/25
 * Time: 11:55
 */

//echo $_COOKIE['name'];

session_start();
echo $_SESSION['name'];

//unset($_SESSION['name']);
//session_destroy();

echo $_SESSION['name'];



你可能感兴趣的:(php【基础学习六】会话)