Hello When I use have set session in the past for front end and admin I have set them like
And
But I was thinking if could do it this way
My question is. Is the way below OK?
Code:
$this->session->set_userdata('admin', array('some admin array items'));And
Code:
$this->session->set_userdata('catalog', array('some front end array items'));But I was thinking if could do it this way
My question is. Is the way below OK?
PHP Code:
$_SERVER['REQUEST_URI_PATH'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$segments = explode('/', $_SERVER['REQUEST_URI_PATH']);
$config['sess_driver'] = 'files';
if ($segments[2] == 'admin') {
$config['sess_cookie_name'] = 'admin_sessions';
$config['sess_expiration'] = 1440;
$config['sess_save_path'] = FCPATH . 'application/cache/session/admin/';
} else {
$config['sess_cookie_name'] = 'catalog_sessions';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = FCPATH . 'application/cache/session/catalog/';
}
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;