2012-12-13 121 views
-1

我已經開始在我的CodeIgniter應用程序中使用Tank Auth,我已經按照一些教程步驟進行設置,只要它有效,它會在帳戶激活期間產生大量錯誤消息,登出。下面是錯誤的:Codeigniter Tank Auth激活和註銷錯誤

A PHP Error was encountered 

Severity: Notice 

Message: Undefined index: session_id 

Filename: libraries/Session.php 

Line Number: 272 

A PHP Error was encountered 

Severity: Notice 

Message: Undefined index: ip_address 

Filename: libraries/Session.php 

Line Number: 272 

A PHP Error was encountered 

Severity: Notice 

Message: Undefined index: user_agent 

Filename: libraries/Session.php 

Line Number: 272 

A PHP Error was encountered 

Severity: Notice 

Message: Undefined index: last_activity 

Filename: libraries/Session.php 

Line Number: 272 

A PHP Error was encountered 

Severity: Notice 

Message: Undefined index: session_id 

Filename: libraries/Session.php 

Line Number: 288 

A PHP Error was encountered 

Severity: Notice 

Message: Undefined index: last_activity 

Filename: libraries/Session.php 

Line Number: 289 

A PHP Error was encountered 

Severity: Warning 

Message: Cannot modify header information - headers already sent by (output started at /projekt/system/core/Exceptions.php:185) 

Filename: libraries/Session.php 

Line Number: 675 

A PHP Error was encountered 

Severity: Warning 

Message: Cannot modify header information - headers already sent by (output started at /projekt/system/core/Exceptions.php:185) 

Filename: helpers/url_helper.php 

Line Number: 542 

這裏是在參考點代碼:

foreach (array('session_id','ip_address','user_agent','last_activity') as $val) 
    { 
     unset($custom_userdata[$val]); 
     $cookie_userdata[$val] = $this->userdata[$val]; //272 line 
    } 

    $this->CI->db->where('session_id', $this->userdata['session_id']); //288 line 
    $this->CI->db->update($this->sess_table_name, array('last_activity' => //289 line $this->userdata['last_activity'], 'user_data' => $custom_userdata)); 
setcookie(// 675 line 
       $this->sess_cookie_name, 
       $cookie_data, 
       $expire, 
       $this->cookie_path, 
       $this->cookie_domain, 
       $this->cookie_secure 
     ); 
+0

OK內笨資源,什麼是你的問題? –

+2

請注意每個錯誤如何引用行號?如果我們無法看到該行號碼處的內容,您希望我們如何幫助您? – xbonez

+0

我在嘗試使用tankauth時會遇到同樣的問題,會話被保存到數據庫,並且下面的鏈接/註釋並沒有幫助,因爲它已經在使用坦克auth庫..wish這不關閉.. –

回答

1

它看起來並不像這些錯誤是嚴重的人,因爲他們都還只是在錯誤層次的通知級別。我會查看代碼點火器的源代碼,看看發生了什麼。該源碼值得了解如何編輯和導航,因爲這會節省時間。由於我沒有使用坦克認證,我不確定確切的問題是什麼。我建議在你的源代碼中設置var_dump語句來跟蹤它發生了什麼。它看起來好像某些模型或會話變量不存在於您的庫的上下文中或您正在使用的其他第三方工具。您可能需要聲明一個codeigniter實例才能使用這些第三方工具,因爲它們存在於codeigniter範圍之外。

$_CI =& get_instance(); // creates a CI instance that can exist outside of the MVC setup 

您可以在部分簽出更多的在這個教程:利用你的圖書館 http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html

相關問題