[eluser]Unknown[/eluser]
Hello guys, I need your help >.< my session is not working can you check my code and slap me. I already load the session library but still not working...
Code:
function login()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('email', 'Email Address', 'trim|required|valid_email|xss_clean');
$this->form_validation->set_rules('password', 'Password', 'trim|required|min_length[6]|xss_clean');
if($this->form_validation->run()== FALSE)
{
$data['main_content'] = 'pages/login_page';
$this->load->view('includes/template', $data);
}
else
{
$this->load->model('membership_model');
$query = $this->membership_model->validate();
if($query)
{
$data = array('email' => $this->input->post('email'), 'is_logged_in' => TRUE);
$this->session->set_userdata($data);
redirect('site/members_area');
}
else
{
$this->no_record();
}
}
thanks...