I want to set the session time out for OTP,after set the time OTP will expire
Controlller code as shown in below
$six_digit_random_number = mt_rand(100000, 999999);
$this->session->set_userdata('otp', $six_digit_random_number);
$this->load->model('Login_model');
$pass['pass'] = $this->Login_model->forgot_pass_retrive($emailTo);
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_port'] = '465';
$config['smtp_timeout'] = '7';
$config['smtp_user'] = 'tworkreport@gmail.com';
$config['smtp_pass'] = '87xxxxxxxx';
$config['charset'] = 'utf-8';
$config['newline'] = "
";
$config['mailtype'] = 'text';
$config['validation'] = TRUE;
$this->email->initialize($config);
$this->email->from('tworkreport@gmail.com', 'Terasukhintrade');
$this->email->to($emailTo);
$this->email->subject('Reset your password');
$this->email->message('Click on link to reset your password '.$this->session->userdata['otp'] );
$this->email->send();
echo $this->email->print_debugger();
$this->load->view('login',$data);
} else {
$this->session->set_flashdata('message', ' Email address not found!');
$this->load->view('login',$data);
}
}
}