1. [代码] session.php ?phpsession_start();$_SESSION['name']="陌陌";$_SESSION['age']=19;echo 'session:br/';print_r($_SESSION);echo 'br/cookie:br/';print_r($_COOKIE);echo 'br/这是session.php';/* *第一次输出: session: Array ( [nam
1. [代码]session.php
<?php session_start(); $_SESSION['name']="陌陌"; $_SESSION['age']=19; echo 'session:<br/>'; print_r($_SESSION); echo '<br/>cookie:<br/>'; print_r($_COOKIE); echo '<br/>这是session.php'; /* *第一次输出: session: Array ( [name] => 陌陌 [age] => 19 ) cookie: Array ( ) 这是session.php * * 之后输出: session: Array ( [name] => 陌陌 [age] => 19 ) cookie: Array ( [PHPSESSID] => hpl14nebl5ch91c3vefvq018h3 ) 这是session.php * */ ?>
2. [代码]testsession.php
<?php session_start(); echo 'session:<br/>'; print_r($_SESSION); echo '<br/>cookie:<br/>'; print_r($_COOKIE); echo '<br/>这是testsession.php'; /* *输出: session: Array ( [name] => 陌陌 [age] => 19 ) cookie: Array ( [PHPSESSID] => hpl14nebl5ch91c3vefvq018h3 ) 这是testsession.php * */ ?>