PHP会话ajax不同步
页面show2.php:PHP会话ajax不同步,php,jquery,ajax,session,Php,Jquery,Ajax,Session,页面show2.php: <?php session_start(); $_SESSION["abc"]=2; print $_SESSION["abc"]; include 'import/function.php'; ?> <html> ............. </html> 当我进入show1.php时,页面print 1和ajax_调用print 1。 当我进入show2.php时,页面会打印2,但ajax会调用打印
<?php
session_start();
$_SESSION["abc"]=2;
print $_SESSION["abc"];
include 'import/function.php';
?>
<html>
.............
</html>
当我进入show1.php时,页面print 1和ajax_调用print 1。
当我进入show2.php时,页面会打印2,但ajax会调用打印1!为什么?向我们展示ajax调用,function.php在做什么?您确定没有复制
$\u SESSION[“abc”]=1将>编码到处理post的php脚本中?
<?php
session_start();
$_SESSION["abc"]=1;
print $_SESSION["abc"];
include 'import/function.php';
?>
<html>
.............
</html>
session_start();
include 'import/function.php';
if(isset($_POST["data"]))
{
print $_SESSION["abc"];
}