I am using the below php code to create and store a cookie.
if ($logged_in_user['slots'] > $this->devices_model->count_devices($logged_in_user['id'])) {
//HERE SHOULD BE PLACED WHAT I NEED
$cookie = array(
'name' => 'kolass_app',
'value' => md5(uniqid($logged_in_user['id'], true)),
'device' => $this->agent->browser() . ' ' . $this->agent->version(),
'expire' => time() + (10 * 365 * 24 * 60 * 60),
);
$this->input->set_cookie($cookie);
$data['user_id'] = $logged_in_user['id'];
$data['device'] = $cookie['device'];
$data['value'] = $cookie['value'];
$this->devices_model->add_device($data);
redirect(base_url());
}
How can i get a user action yes or no before continuing the creation and saving of the cookie.
I am using Codeigniter