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 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型