douyi7055 2011-01-27 14:28
浏览 94
已采纳

在添加“www”后,PHP Session被视为不同的域。 在网页前面

if i am setting a session in http://example.com/path/file1.php

then can't getting it in http://www.example.com/path/file2.php but getting the value in http://example.com/path/file2.php

  • the "www." is creating the issue.

Is that a bug?

  • 写回答

3条回答 默认 最新

  • duangan2307 2011-01-27 14:32
    关注

    no, thats intended behaviour.

    "" is treated as another subdomain than "www" (or other ones, if you have more subdomains), and so it's saved in a different cookie (per default, a cookies validity is per domain).

    to avoid this, you could simply redirect users that enter from http://example.com/path/file1.php (or anything else with "example.com") to http://www.example.com/path/file1.php (or anything else with "www.example.com")

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

报告相同问题?

悬赏问题

  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题