示例程序:test_session.php3 <?php require( session.inc.php3); require(cookie.inc.php3); ?> <?php session_checkid( 20 ); //20分钟后session失效 //下面你需要设置mysql的连接参数 mysql_connect(‘localhost’,’user’,’pass’) or Die(can’t connect to db!); ?> <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2 Final//EN> <