dousao6313 2015-11-25 17:09
浏览 54
已采纳

PHP会话变量和身份验证

I have two pages which I need to pass session information between them. Here's page one.

<?php
session_start();
echo session_id()."<br>";
echo $_SESSION['test']."<br>";

Page two.

<?php
session_start();
echo session_id()."<br>";
$_SESSION['test'] = 'test';
echo $_SESSION['test'];

Page two is in a different directory (same domain), and has Windows Authentication on. Page one is using anonymous authentication. From the output I can see the session ID is the same, but page one doesn't echo the test variable set from page two.

I'm running PHP in IIS 8.5 on Server 2012 R2.

Any help is appreciated.

To clarify, I am calling page two first, and page one will not show the variable.

  • 写回答

3条回答 默认 最新

  • doume5227 2015-11-25 17:41
    关注

    The issue was with permissions on the session save path. I changed the path to where both directories could write and it works.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大