session_1.php
<?php // session_start(); $_SESSION['class_name'] = 'PHP34'; $_SESSION['teacher_name'] = 'Kang'; unset($_SESSION['teacher_name']); $_SESSION['class_name'] = 'ITCAST-PHP34'; var_dump($_SESSION['class_name']); //输出:string(12) "ITCAST-PHP34"
session_2.php
<?php session_start(); echo $_SESSION['class_name'];//输出:ITCAST-PHP34