dtrphb5597 2017-02-20 11:35
浏览 78
已采纳

CodeIgniter 3 + Docker - 会话

I'm migrating my CodeIgniter 3 app into Docker and I have session issue. I can't login to app, because of CI sessions.

It seems like CodeIgniter recreates new session with each request to the server. When I checked what $_COOKIE contains i can see two fields:

PHPSESSID - always the same (i even tried manually start php session)
ci_session - changes with every request

Files for new sessions are created by www-data user and have right permissions.

Session config:

$config['base_url'] = 'http://localhost';

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = sys_get_temp_dir();
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

$config['cookie_prefix']    = '';
$config['cookie_domain']    = '';
$config['cookie_path']      = '/';
$config['cookie_secure']    = FALSE;
$config['cookie_httponly']  = FALSE;

Docker images: php:7.1-fpm, nginx:latest, mysql:latest

I haven't idea what's going on. Can anybody help me?

  • 写回答

1条回答 默认 最新

  • dqxyh48864 2017-02-20 12:08
    关注

    OK, problem solved.

    I must update CodeIgniter to older version, because of currently installed isn't compatible with PHP 7.1 (only with 7.0).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 wpf界面一直接收PLC给过来的信号,导致UI界面操作起来会卡顿
  • ¥15 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗
  • ¥15 运动想象脑电信号数据集.vhdr
  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了