doufangzhang4454 2012-11-28 20:59
浏览 36

PHP - 不在服务器上的页面之间传递的会话[重复]

Possible Duplicate:
PHP Session Id changes between pages

I have an issue regarding sessions on the live server. The previous developer coded the site and all was working fine until we had to upgrade the server to php 5.2 last week. Then all the sessions stop working and users were unable to log in. I removed the use of session_register etc but nothing worked.

For a simple test, I copied a very simple session script from php.net and tried it on my machine and it worked. Once I loaded it onto the server, the second page would not display the session variable I created in the first page.

Is there any configuration that needs to be set up on the server in order to pass session variables?

I used print_r($_SESSION) on page one and it showed the session created, i used it again on page two and the array was empty.

Any help or suggestions would be greatly appreciated.

edit:

    session_start();

was included on all pages and

    print_r($_SESSION)

showed on page 1 that the session was created and that on page two it was not passed

  • 写回答

1条回答 默认 最新

  • doucuodan0897 2012-11-28 21:02
    关注

    Did you start the session using session_start()? - http://php.net/manual/en/function.session-start.php

    评论

报告相同问题?

悬赏问题

  • ¥15 对于这个问题的代码运行
  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败