问题描述
我已经尝试了所有方法来在Codeigniter(3.0.6)和Tank Auth(用于登录和注册的插件)中设置会话。什么都没有为我工作。
这是我的ci_session表数据。
以下是该会话的我的配置文件信息。
{
"main": "node_modules/expo/AppEntry.js","scripts": {
"start": "expo start","android": "expo start --android","ios": "expo start --ios","web": "expo start --web","eject": "expo eject"
},"dependencies": {
"@react-native-community/async-storage": "^1.11.0","@react-native-community/masked-view": "0.1.10","@react-navigation/material-bottom-tabs": "^5.2.16","@react-navigation/material-top-tabs": "^5.2.16","@react-navigation/native": "^5.7.3","@react-navigation/stack": "^5.9.0","@reduxjs/toolkit": "^1.4.0","expo": "~38.0.8","expo-status-bar": "^1.0.2","react": "~16.11.0","react-dom": "~16.11.0","react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz","react-native-elements": "^2.2.1","react-native-gesture-handler": "~1.6.0","react-native-paper": "^4.0.1","react-native-reanimated": "~1.9.0","react-native-safe-area-context": "~3.0.7","react-native-screens": "~2.9.0","react-native-tab-view": "^2.15.1","react-native-web": "~0.11.7","react-redux": "^7.2.1","redux": "^4.0.5"
},"devDependencies": {
"@babel/core": "^7.8.6","babel-preset-expo": "~8.1.0"
},"private": true
}
Tank Auth配置:
$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;
我也尝试在控制器中打印$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;
,但成功登录后看不到会话数据。
我早在4年以前就使用了这种组合(Codeigniter和TankAuth)。我没有得到这样的问题,这是一个快速的设置。但现在情况有所不同,无法正常工作。
$_SESSION
解决方法
3.x早期版本报告了多个会话问题,并且与PHP版本> = 7.1不兼容:
这些问题已在更高版本中得到解决,请仅对CI 3.1.11进行快速更新。
您可以在此答案中找到更多详细信息:https://stackoverflow.com/a/46876622/2275490