I have a situation where by I need to store information into codeigniters session -> be able to close the browser window -> then open up the browser window and for it to recover all the items I stored in a session. I'm aware codeigniter doesn't actually use sessions and instead cookies so this should be really easy.... but it's not.
In FF / Safari / Chrome this works fine but in IE 9 when I close and then re-open the window it regenerates the session id and doesn't pull back the data.
For example this simple code:
$this->CI->session->set_userdata('username','My Username');
echo $this->CI->session->userdata('username');
when run the first time outputs as expected. I then comment out line 1 and refresh the screen and the session data is again displayed correctely.
Now I close the browser window and open it back up to the same page, again with line 1 commented out. It can't find the session data and the session id is now changed.
I have sessions saving to the database in codeigiter and my session config looks like:
$config['sess_cookie_name'] = 'bcsession';
$config['sess_expiration'] = 0;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = FALSE;
$config['sess_time_to_update'] = 300;