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条)

报告相同问题?

悬赏问题

  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏