看板 PHP 關於我們 聯絡資訊
※ 引述《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
uest:done!原來是我之前在php.ini裡面把session.use_cookie重設之 09/19 14:47
uest:後,忘記把server重開,所以cookie一直都沒有存起來...THX 09/19 14:49
uest:噗!!SID沒有問題了,可是session的值還是傳不過去.... 09/19 15:44