Hi,
I have been stuck in this issues from last several days, And I have tried all the solution exists on the internet, that's why I am raising a new topic. Please help me.
Ok so the Issue is, When the user tries to log in, so after successfully authentication (Service Hit on other server), I call the CI 3.1.11 controller method to set the session via AJAX request, and passed information in ajax request is saved into session, Which actually set (i have tested that) and once the ajax call returns and after performing another jquery function, I redirect the user to the dashboard page, now as soon as the dashboard method called (on the same controller), session destroyed Only and only in Firefox (not chrome, safari, opera ).
Config File :
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'mcookie';
$config['sess_expiration'] = 0 ;
$config['sess_save_path'] = APPPATH.'session/';
$config['sess_match_ip'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
$config['sess_expire_on_close'] = TRUE;
$config['sess_match_useragent'] = FALSE;
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = TRUE;
$config['cookie_httponly'] = FALSE; (All are secure requests)
Routes.php
$route['login'] = "home/login";
$route['dashboard'] = "home/dashboard";
Autoloader file :
$autoload['libraries'] = array('form_validation', 'session');
$autoload['helper'] = array('url', 'file');
I have already altered the session.php file like commented session_start(); and lines after "
security Is king" text, and started the session in index.php file at top,
Also Changed
//OR ! preg_match('#\A'.$this->_sid_regexp.'\z#', $_COOKIE[$this->_config['cookie_name']])
to
OR ! preg_match('/^[0-9a-f]/', $_COOKIE[$this->_config['cookie_name']])
And
ini_set('session.name', $params['cookie_name']);
to
ini_set('session.id', $params['cookie_name']);
But nothing works. Also As I am saving sessions in files, So I don't see any session files created in the mentioned folder. I have tried giving 0700 and 0777 permissions.
But yes, if after successful authentication, i refresh the page several times, then session starts persisting.
Guys please please help me, I am not very good at Codeigniter and I am still learning,