Welcome Guest, Not a member yet? Register   Sign In
codeigniter login page working in firefox but not working in chrome
#1

[eluser]Unknown[/eluser]
$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'] = 'acad_sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 180;

$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;


theese are my settings in config.php

please help us we have to complete the project by 12th

the sessions are not set in chrome
#2

[eluser]byde[/eluser]
As far as i know sessions are not stored in the browser unlike the cookies so please post your code so we can see what you are doing
#3

[eluser]Unknown[/eluser]
function validate()//function called when login form is submitted
{
$this->load->model('login_model');
$info= $this->login_model->validateuser();
if($info)
{
$type=$info[0]['user_type'];
$status=$info[0]['status'];
//die("reached here");
if($status == "active" ){
$data = array('user_id' => $this->input->post('username'),
'is_logged_in' =>true,
'user_type' => $type
);
$this->session->set_userdata($data);
//die("reached here");
//echo "Sessions are set";

if($type=="student")
redirect('student/student');
elseif($type=="admin")
redirect('admin/admin');
elseif($type == "faculty")
redirect('faculty/faculty');
}
else{
redirect('login');
}
}
else {
$message="Username/password is incorrect";
$this->index($message);
}

}
after they bieng redirected but the session variables are not set in another controller so it takes us to login
#4

[eluser]Atharva[/eluser]
Also post code where you trying to access the session variables.
#5

[eluser]InsiteFX[/eluser]
Even if your using database sessions it still stores a cookie!

Sounds like Chrome is not storing the cookie, check Chrome's cookie options!
Check to see if Chrome is storing the cookie!

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB