0

I checked for the session cookie in edge and it was not available. In chrome, the session cookie works fine. I tried both php superglobal $_SESSION[] and the magic getter $this->session->set_userdata($newdata); while setting session

Here are the session config values:

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'cekosessions';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'cekosessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

Here are the cookie config values:

$config['cookie_prefix'] = 'ncitce';
$config['cookie_domain'] = 'localhost';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = TRUE;
  • try Using vhost for project. –  Jan 30 '17 at 04:38
  • And to get codeigniter session after has been set `echo $this->session->userdata('user_id')` –  Jan 30 '17 at 05:31
  • Have no idea on vhost. Tried getting vhost to run but didn't work. Will look on that later. I'm in kind of hurry. Anyway, thanks. I think I figured out something with your mention of vhost. – Sanjeev Maharjan Jan 30 '17 at 05:54
  • 1
    vHost is where you can use a dummy domain on your xampp wamp etc http://stackoverflow.com/questions/27268205/how-to-create-virtual-host-on-xampp https://www.youtube.com/results?search_query=virtual+host+xampp –  Jan 30 '17 at 07:40

2 Answers2

0

Actually, All my CodeIgniter 3 projects work fine in Edge. Please try this configuration in config.php file

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

and

$config['cookie_prefix']    = '';
$config['cookie_domain']    = '';
$config['cookie_path']      = '/';
$config['cookie_secure']    = FALSE;
$config['cookie_httponly']  = FALSE;

Remember to create ci_session table in your database.

    CREATE TABLE IF NOT EXISTS `ci_sessions` (
        `id` varchar(128) NOT NULL,
        `ip_address` varchar(45) NOT NULL,
        `timestamp` int(10) unsigned DEFAULT 0 NOT NULL,
        `data` blob NOT NULL,
        KEY `ci_sessions_timestamp` (`timestamp`)
);

If above method failed please comment below.

Geordy James
  • 2,358
  • 3
  • 25
  • 34
0

If you are using a lower codeigniter version, you can replace the Session class of CI with this class, which stores session data on the server:

https://github.com/bcit-ci/CodeIgniter/wiki/Dariusz-Debowczyk%27s-Session-Class

Also see this link for a discussion: https://expressionengine.com/forums/archive/topic/135722/codeigniter-session-problems-thread

Lenka Pitonakova
  • 979
  • 12
  • 14