[eluser]spider pig[/eluser]
I am working on a backend of a site. The login uses CI sessions and works fine in Safari, Firefox and IE 6 but not IE 7. Here's the code that verifies the user and sets the session variables. Session is set to autoload.
Code:
function submit() {
$this->main->load_settings();
// Verify Data
$errorMessage = NULL;
if ($_POST['username'] == NULL)
$errorMessage = 'Your Username is required.<br />';
if ($_POST['password'] == NULL)
$errorMessage .= 'Your Password is required.<br />';
if ($_POST['username'] != NULL and $_POST['password'] != NULL) {
$query = $this->db->get_where('admin_user', array('userUsername' => $_POST['username'], 'userPassword' => md5($_POST['password'])));
if ($query->num_rows() == 0) {
$errorMessage .= 'The Username or Password is incorrect.<br />';
} else {
$row = $query->row();
if ($row->userStatus != 'Active')
$errorMessage .= 'Your account has been de-activated.<br />';
}
}
if ($errorMessage != NULL) {
// re-display login form
return;
}
$this->session->set_userdata('userID', $row->userID);
$this->session->set_userdata('userGroup', $row->userGroup);
$this->load->helper('url');
redirect('main_menu', 'refresh');
}
This function is called a to check if the person is logged in:
Code:
function check() {
$data = array('userID' => $this->session->userdata('userID'),
'userGroup' => $this->session->userdata('userGroup')
);
$query = $this->db->get_where('admin_user', $data);
if ($query->num_rows() == 0) {
echo $this->load->view('redirect', NULL, TRUE);
return FALSE;
}
return TRUE;
}
These are the session settings:
Code:
$config['encryption_key'] = "apassword";
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_encrypt_cookie'] = TRUE;
$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;
Is there a way to fix the problem with IE 7?
Thanks