dtxpz8785 2015-10-04 17:08
浏览 177

在php中存储多个$ _SESSION变量,并在另一个页面中回显它们

In the same browser, not on the same domain:

If on the site A, I store in session:

session_start();
$_SESSION['fruit'] = "Apple";

If on the site B, I store in session:

session_start();
$_SESSION['color'] = "green";

How can I echo on the site C :

// Apple is green.
session_start();
$_SESSION['fruit'].' is '.$_SESSION['color'];

Is it possible I echo, from another domain but in the same browser, all the $_SESSION variables ?

Thanks for the help.

  • 写回答

3条回答 默认 最新

  • douwen3083 2015-10-04 17:13
    关注

    Short answer: No.

    Long answer: Well... no but kind of yes, if you build two separate apps, one for each domain and send the session from one app to the other over an interface (e.g. a REST endpoint).

    评论

报告相同问题?

悬赏问题

  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入