【发布时间】:2016-05-07 04:44:41
【问题描述】:
CI3 中的 CAS 身份验证库有问题。在 CI2.x 中完美运行,但在 CI3 中,会话已被重新设计,并且该库似乎存在问题。
这是我得到的错误:
A PHP Error was encountered
Severity: Runtime Notice
Message: session_start() [function.session-start]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '1.0/no DST' instead
Filename: CAS/Client.php
A PHP Error was encountered
Severity: Error
Message: session_start() [function.session-start]: Failed to initialize storage module: user (path: C:\Windows\Temp)
Filename: CAS/Client.php
这是我的 config.php 设置:
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
请注意,我在数据库中使用名为“ci_sessions”的表来存储 CI3 用户手册中所述的会话。它工作得很好,但是一旦我加载了 CAS 库,我在session_start() 行中得到了之前的错误。
CAS 库额外信息 https://github.com/eliasdorneles/code-igniter-cas-library 有人写了一个代码来轻松地将 phpCAS 集成到 Codeigniter 2.X 中,但它不再被维护或更新到 CI3。
对我来说,必须使用 CAS 身份验证方法,关于如何修复此错误或使用其他替代 CAS 客户端的任何想法?
非常感谢。
【问题讨论】:
-
那些
[color=#ff3366]真的在你的配置中吗? -
对不起颜色标签,当然这是一个论坛问题,我的代码中没有它们。而另一个线程建议,它没有解决方案,因为它指的是CI2.x。还是谢谢。
标签: php codeigniter session authentication cas