設置SESSION_ID在標準的PHP我可以通過以下設置會話ID:CI中
$my_session_id = $_GET['session_id']; //gets the session ID successfully
session_id($my_session_id); //sets the session with my session_id
session_start(); //starts session.
我該怎麼做同樣的用笨?我正在嘗試以下方法:
$my_session_id = $_GET['session_id']; //gets the session ID successfully
$this->session->userdata('session_id', $my_session_id); //it won't set the session with my id.
print_r($this->session->userdata);
我是否犯了一些錯誤?請幫助我,因爲我在這個問題上浪費了幾個小時。如果CodeIgniter Session類存在問題,我可以使用標準PHP代碼來啓動會話嗎?我試圖在CodeIgniter中放置標準代碼,但它仍然沒有設置session_id。我也設置了$config['sess_match_useragent'] = FALSE;
謝謝,我不有MY_Session文件,我是否需要在CodeIgniter的庫文件夾或Core文件夾中創建MY_Session.php文件?在創建併發布此代碼之後,我將如何調用MY_Session? (對不起,我是CodeIgniter或任何框架的新手) – Roman
如果您將MY_Session.php文件放在您的庫文件夾中,它將被用來代替CI_Session – cwallenpoole