Codeigniter Tank_auth session not set

狂风中的少年 提交于 2021-01-29 07:03:37

问题


I have tried all the ways to set the session in the Codeigniter (3.0.6) and Tank Auth (a plug in for Login and Registration). Nothing is working for me.

Here is my ci_session table data.

Below is my Config file info for the session.

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_session';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
$config['sess_use_database'] = TRUE;

Tank Auth config :

$config['login_by_username'] = TRUE;
$config['login_by_email'] = TRUE;
$config['login_record_ip'] = TRUE;
$config['login_record_time'] = TRUE;
$config['login_count_attempts'] = FALSE;
$config['login_max_attempts'] = 10;
$config['login_attempt_expire'] = 60*60*24;

Also I have tried to print the $_SESSION in a controller, but I don't see the session data after the successful login.

I have used this combination (Codeigniter and TankAuth) long back (4 years before). I did not get such issues, it was a quick setup. But now it is something different and not working.

Array
(
    [__ci_last_regenerate] => 1597612277
)

回答1:


There have been several Session issues reported with early 3.x versions and for incompatibility of PHP version >= 7.1 :

  • https://github.com/bcit-ci/CodeIgniter/issues/4830

Those issues were resolved with the later releases, please just perform a quick update to CI 3.1.11.

you find further in depth details in this answer: https://stackoverflow.com/a/46876622/2275490



来源:https://stackoverflow.com/questions/63442029/codeigniter-tank-auth-session-not-set

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!