2014年4月15日 星期二

CodeIgniter Login&Logout

在未接觸 CI 的 Session之前,相信大家所使用的都是 $_SESSION[]

但 CI 的 Session 是將每個使用者的 Session 資訊序列化,並經由 MD5 加密後,儲存在 Cookie 中,除此之外,亦可將 Session 資料儲存在資料庫中,藉此比對使用者的 Cookie中儲存的 Session_id 是否與資料庫中的 id 符合,來增強此安全性。

而 native session 是將 原生的 php session 處理功能對原有的 CI session  實現,並且需要額外的安全寫入

在 CI 3.0.x 會將 Session 變成 Driver ,提供 cookie session 和 native session



這是 appleboy 所提供的 Native Session Code

https://github.com/appleboy/CodeIgniter-Native-Session/tree/f3a389281fbfe9cf685550a8e15cbcdd1cccc249


完成後

進去取得 code

https://github.com/wooxer88/CodeIgniter_login-logout

資料表

table name = users
      uid 自動排列
      uname 使用者帳號
      password 使用者密碼
      name 使用者姓名
      email 電子郵件
      privileges 權限
    


資料來源

沒有留言 :

張貼留言