經過研究發現是 CodeChargeStudio 的 Common.php中有這一行:
if (session_id() == "") { session_start(); }
if (CCGetUserAddr() != $_SERVER["REMOTE_ADDR"]) { CCLogoutUser(); }
也就是 CCS 會檢查 REMOTE_ADDR,如果不一樣就會被強制登出!
解決這個問題,就必須拿掉這一行檢查。
//Initialize Common Variables @0-8AF2F782
$PHPVersion = explode(".", phpversion());
if (($PHPVersion[0] < 4) || ($PHPVersion[0] == 4 && $PHPVersion[1] < 1)) {
echo "Sorry. This program requires PHP 4.1 and above to run. You may upgrade your php at <a href='http://www.php.net/downloads.php'>http://www.php.net/downloads.php</a>";
exit;
}
if (session_id() == "") { session_start(); }
if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
}
// if (CCGetUserAddr() != $_SERVER["REMOTE_ADDR"]) { CCLogoutUser(); }
沒有留言:
張貼留言