session,autoload(),有關問題。尋高手賜教。

來源:互聯網
上載者:User
session,__autoload(),問題。尋高手賜教。-。-
我開啟了一個session以後,我想要設定session的有效時間,怎麼設定!我改了PHP.ini設定檔裡面的session.cache_expire = 1,沒有實現... 修改了session.gc_maxlifetime=10,也沒有得到預想的效果。求教 -。-!



還有。。。。。。。
php檔案載入 __autoload($class_name){
}


我在第一個檔案裡面使用autoload()引入其他檔案,在第二個檔案開始也使用了該方法。然後我在3個檔案裡面對2個類進行執行個體化。 err:Cannot redeclare __autoload() (previously declared in C:\AppServ\www\test\autoload_test.php:1) in C:\AppServ\www\test\include1.php on line 4
簡潔代碼:
檔案1:
function __autoload($class_name){
include $class_name.".php";
}
class include1{}
?>
檔案2:
function __autoload($class_name){
include $class_name.".php";
}
class include2{}
?>
檔案3:
include $class_name.".php";
}
$inculde1=new include1();
$inculde2=new include2();
?>
請指教.

------解決方案--------------------
第二個問題 你已經在第三個檔案中聲明了此函數,不用再別的地方重新成名了。
------解決方案--------------------
session_cache_expire(1);確保放在 session_start()之前
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.