I know there are so many question about this set_cookie()
CI, but I can't found the answer, the cookie doesn't showing in Google Cookies Data menu.
I know how to read it, but it doesn't showing at all in the browser cookies data.
in ControllerFile.php
$this->load->helper('cookie');
$cookie = array(
'name' => 'pre',
'value' => $token,
'expire' => 86400 * 7,
);
$this->input->set_cookie(
$cookie['name'], $cookie['value'], $cookie['expire']
);
The setting in config.php
$config['cookie_prefix'] = 'e_';
$config['cookie_domain'] = '.localhost';
$config['cookie_path'] = '/project.com/catch/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
This website Project is under project.com folder, this is what it looks like
htdocs/
---- project.com/
-------- catch/
------------ *CI files*
--------- *files*
--------- *files*
---- anotherproject.com/
---- anotherproject.com/
---- anotherproject.com/
But there are no cookie data for [::1]
nor .localhost
, why does this happening?
I already tried to googled it but can't found the solution, I already tried with
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
But it doesn't work either.
Adding log file
INFO - 2018-05-18 08:28:37 --> Config Class Initialized
INFO - 2018-05-18 08:28:37 --> Hooks Class Initialized
DEBUG - 2018-05-18 08:28:37 --> UTF-8 Support Enabled
INFO - 2018-05-18 08:28:37 --> Utf8 Class Initialized
INFO - 2018-05-18 08:28:37 --> URI Class Initialized
INFO - 2018-05-18 08:28:37 --> Router Class Initialized
INFO - 2018-05-18 08:28:37 --> Output Class Initialized
INFO - 2018-05-18 08:28:37 --> Security Class Initialized
DEBUG - 2018-05-18 08:28:37 --> Global POST, GET and COOKIE data sanitized
INFO - 2018-05-18 08:28:37 --> Input Class Initialized
INFO - 2018-05-18 08:28:37 --> Language Class Initialized
INFO - 2018-05-18 08:28:37 --> Loader Class Initialized
INFO - 2018-05-18 08:28:37 --> Helper loaded: url_helper
INFO - 2018-05-18 08:28:37 --> Helper loaded: file_helper
INFO - 2018-05-18 08:28:37 --> Helper loaded: form_helper
INFO - 2018-05-18 08:28:37 --> Database Driver Class Initialized
INFO - 2018-05-18 08:28:37 --> Email Class Initialized
DEBUG - 2018-05-18 08:28:37 --> Session: "sess_save_path" is empty; using "session.save_path" value from php.ini.
INFO - 2018-05-18 08:28:37 --> Session: Class initialized using 'files' driver.
INFO - 2018-05-18 08:28:37 --> Form Validation Class Initialized
INFO - 2018-05-18 08:28:37 --> Controller Class Initialized
INFO - 2018-05-18 08:28:37 --> Model "User_model" initialized
INFO - 2018-05-18 08:28:37 --> Model "Cookie_model" initialized
INFO - 2018-05-18 08:28:37 --> Helper loaded: string_helper
INFO - 2018-05-18 08:28:37 --> Helper loaded: cookie_helper
INFO - 2018-05-18 08:28:37 --> Language file loaded: language/english/form_validation_lang.php
INFO - 2018-05-18 08:28:37 --> Final output sent to browser
DEBUG - 2018-05-18 08:28:37 --> Total execution time: 0.1759
As you can see, in the log file there are no error message at all
My Google chrome setting