Reputation: 1009
I am trying to create a session last forever in php, with codeignter framework.
My session settings at config.php are :
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'org_session';
$config['sess_expiration'] = 0;
$config['sess_save_path'] = 'org_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
Eventhough the expiration is zero, still session expires after browser closes. Any idea how to make this work? I am use mysql database to store session data.
Upvotes: 1
Views: 707
Reputation: 11
I think using conditions, if the ip adress an the cookies params have especific info then redirect index page, and not to login page
if($ipaddress == 'foo' && $cookie['infinity'] == 'true'){
$info= $model->getuser($ipaddress);
if($info){
redirect('index.php');
}else{
redirect('login.php);
}
}
Upvotes: 0