作者alpe (薛丁格的猫)
看板PHP
标题Re: [请益] session无法在网页间传递
时间Tue Sep 19 13:54:16 2006
※ 引述《uest (uest)》之铭言:
: b.php永远没办法读到a.php里面生成的session
: 不过照版友的方法,我在a.php及b.php把session_id印出来之後
: 两个id是不相同的,而且每reload一次,session_id就会更新一次
: 注:
: 1.一直测试失败的那台机器上的php版本是4.0.5,新机器是php5
囧... ...
那你有没有想过为什麽 session_id 会不一样... ...
都已经知道问题在那了
Passing the Session ID
There are two methods to propagate a session id:
*Cookies
*URL parameter
The session module supports both methods. Cookies are optimal, but
because they are not always available, we also provide an alternative way.
The second method embeds the session id directly into URLs.
PHP is capable of transforming links transparently.
Unless you are using PHP 4.2 or later, you
need to enable it manually when building PHP.
Under Unix, pass --enable-trans-sid to configure.
If this build option and the run-time option session.
use_trans_sid are enabled, relative URIs will be changed to
contain the session id automatically.
http://tw.php.net/manual/en/ref.session.php
--
Live Long and Prosper
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 202.132.72.186
1F:推 uest:done!原来是我之前在php.ini里面把session.use_cookie重设之 09/19 14:47
2F:→ uest:後,忘记把server重开,所以cookie一直都没有存起来...THX 09/19 14:49
3F:→ uest:噗!!SID没有问题了,可是session的值还是传不过去.... 09/19 15:44