Can you help me please with authentication in Codeigniter? I start with CI yesterday so I am little confused. I found Tank auth library, but it seems it is not compatible with CI3. It throws me an error: "Unknown column 'data' in 'field list'" from libraries/Session/drivers/Session_database_driver.php Session library expects the field name data in ci_session table. My ci_session table comes from Tank auth download and there is user_data field instead. What can I do? Or is there a better authentication library for CI3? I wolud like to find lib with authentication + authorisation.
1条回答 默认 最新
- douli4852 2015-10-22 16:06关注
Late answer, but it might be useful to someone. To get Tank Auth working in Codeigniter 3:
In
config.php
, remove the options which are no longer in the new defaultconfig.php
, and add the ones specified in the upgrade guide.Set
sess_driver
tofiles
:$config['sess_driver'] = 'files';
And add an absolute path to the
sess_save_path
option:$config['sess_save_path'] = BASEPATH . 'sessions';
In the
Auth
controller, remove$this->load->library('security');
this is because the security library is loaded automatically.In the same controller, add
$this->load->helper('security');
-- this allows the XSS clean method which is used in Tank Auth's default controller. You might as well also removexss_clean
from the validation rules in theAuth
controller - these are now obsolete. See this this Stack Overflow question.All this is of course assuming that the rest of the instructions in the upgrade guide have been followed.
解决 无用评论 打赏 举报
悬赏问题
- ¥15 #MATLAB仿真#车辆换道路径规划
- ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
- ¥15 数据可视化Python
- ¥15 要给毕业设计添加扫码登录的功能!!有偿
- ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
- ¥15 微信公众号自制会员卡没有收款渠道啊
- ¥100 Jenkins自动化部署—悬赏100元
- ¥15 关于#python#的问题:求帮写python代码
- ¥20 MATLAB画图图形出现上下震荡的线条
- ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘