[eluser]phatphug[/eluser]
I've noticed that my sessions do not appear to work properly in Chrome.
Originally I was storing sessions in the DB, and I noticed that as soon as I started using session->set_userdata, chrome would create a new session every time I loaded the page.
To simplify things, I've turned off DB sessions. My config is as follows:
Code:
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['cookie_prefix'] = "";
$config['cookie_domain'] = ".domain.com";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;
To test, I've made a very simple controller:
Code:
$this->load->library('session');
echo "<p>test_sess = '".$this->session->userdata('test_sess')."'</p>";
$this->session->set_userdata('test_sess', 'test var');
In firefox and all other browsers I've tried you get:
1st hit - test_sess = ''
2nd hit - test_sess = 'test var'
3rd hit - test_sess = 'test var'
In chrome you get:
1st hit - test_sess = ''
2nd hit - test_sess = 'test var'
3rd hit - test_sess = ''
nth hit - test_sess = ''
Analysing the logs both browsers generate identical results except for the following line from Chrome:
ERROR - 2011-05-25 12:17:40 --> The session cookie data did not match what was expected. This could be a possible hacking attempt.
Any idea as to what is causing this? I'm not sure what to try next.
thanks