From d096c3208233c99b4b709d4b9214845af039e933 Mon Sep 17 00:00:00 2001 From: Kim Huebel Date: Tue, 25 Jun 2019 13:46:13 +0200 Subject: [PATCH] Storing Station profile and selected CAT-Radio-controller in cookie The info is stored for 3600*24*99 seconds = 99 days within a local browser cookie. --- application/controllers/Qso.php | 3 +++ application/models/User_model.php | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index e159fd0d..f6e14e03 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -63,6 +63,9 @@ class QSO extends CI_Controller { 'station_profile_id' => $this->input->post('station_profile') ); // ]; + + setcookie("radio", $qso_data['radio'], time()+3600*24*99); + setcookie("station_profile_id", $qso_data['station_profile_id'], time()+3600*24*99); $this->session->set_userdata($qso_data); diff --git a/application/models/User_model.php b/application/models/User_model.php index 267edb75..7ea6ebe8 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -229,7 +229,9 @@ class User_Model extends CI_Model { 'user_lotw_name' => $u->row()->user_lotw_name, 'user_eqsl_name' => $u->row()->user_eqsl_name, 'user_eqsl_qth_nickname' => $u->row()->user_eqsl_qth_nickname, - 'user_hash' => $this->_hash($u->row()->user_id."-".$u->row()->user_type) + 'user_hash' => $this->_hash($u->row()->user_id."-".$u->row()->user_type), + 'radio' => isset($_COOKIE["radio"])?$_COOKIE["radio"]:"", + 'station_profile_id' => isset($_COOKIE["station_profile_id"])?$_COOKIE["station_profile_id"]:"" ); $this->session->set_userdata($userdata);