Heim >Backend-Entwicklung >PHP-Tutorial > php利用memcache 存session 丢数据的有关问题
php利用memcache 存session 丢数据的问题
先上测试代码,大家也可以测试下
index.php
<?php<br /> session_start();<br /> $method = $_GET['Method'];<br /> if(isset($_SESSION['Method'])){<br /> $_SESSION['Method'] = $_SESSION['Method'].$method;<br /> }else{<br /> $_SESSION['Method'] =$method;<br /> }<br /> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /> <html xmlns="http://www.w3.org/1999/xhtml"><br /> <head><br /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><br /> <title>无标题文档</title><br /> </head><br /> <script type="text/javascript" src="http://127.0.0.1/?Method=1" reload="1"></script><br /> <script type="text/javascript" src="http://127.0.0.1/?Method=2" reload="1"></script><br /> <script type="text/javascript" src="http://127.0.0.1/?Method=3" reload="1"></script><br /> <script type="text/javascript" src="http://127.0.0.1/?Method=4" reload="1"></script><br /> <script type="text/javascript" src="http://127.0.0.1/?Method=5" reload="1"></script><br /> <script type="text/javascript" src="http://127.0.0.1/?Method=6" reload="1"></script><br /> <body><br /> </body><br /> </html>