title: CodeIgniter 3 + Docker - Sessions
body: <p>I'm migrating my CodeIgniter 3 app into Docker and I have session issue. I can't login to app, because of CI sessions.</p>
  
  <p>It seems like CodeIgniter recreates new session with each request to the server. When I checked what <code>$_COOKIE</code> contains i can see two fields:</p>
  
  <pre><code>PHPSESSID - always the same (i even tried manually start php session)
  ci_session - changes with every request
  </code></pre>
  
  <p>Files for new sessions are created by <code>www-data</code> user and have right permissions.</p>
  
  <p>Session config:</p>
  
  <pre><code>$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;
  </code></pre>
  
  <p>Docker images: <code>php:7.1-fpm</code>, <code>nginx:latest</code>, <code>mysql:latest</code></p>
  
  <p>I haven't idea what's going on. Can anybody help me?</p>