Welcome Guest, Not a member yet? Register   Sign In
problem on retrieving session userdata
#1

[eluser]Yogesh_89[/eluser]
hello everyone! I am new in CI.....

i has been created session for login, logout. Now i am saving session data into database. As given in user guide how to save session data, i did all things. Now it saving session data.
Problem is that when i changed config file

$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'] = true;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;

now i am checking for session data is set or not in then it not replied any thing. this is code

I am sending userid and pass from view page to controller
function user_login()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('user_name', 'Username', 'required|alpha_dash');
$this->form_validation->set_rules('password', 'Username', 'required|alpha_dash');
if($this->form_validation->run() == false)
{
$this->index();
}
else
{
$this->load->model('login_model');
if($query = $this->login_model->match_info())
{
$this->load->library('session');
$data = array(
'username' => $this->input->post('user_name'),
'is_logged_in' => true
);
$this->session->set_userdata($data);
redirect('user/index');
}
else
{
$this->index();
}
}
}


Messages In This Thread
problem on retrieving session userdata - by El Forum - 10-17-2012, 09:44 AM
problem on retrieving session userdata - by El Forum - 10-17-2012, 09:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB