php - CodeIgniter - flash session deleting all session -
i using flash data success/error messages.
i experiencing issue: after set flashdata - session data deleted in few controlers, in other controlers working properly.
cotroller 1: (function whre working ok)
public function vymazat($id) { if(!is_numeric($id)) redirect(); $this->admin_model->delete_coupon($id); $this->session->set_flashdata('success', 'kupón bol úspešne vymazaný'); redirect('admin/kupony/zobrazit'); }
controller 2: (function not working)
public function vymazat($id) { if(!is_numeric($id)) redirect(); $this->admin_model->delete_order($id); $this->session->set_flashdata('success', 'kupón bol pridaný'); redirect('admin/objednavky/zobrazit'); }
thanks help
from codeigniter documentation:
codeigniter supports "flashdata", or session data available next server request, , automatically cleared.
your redirection may perhaps taking more 1 request, results clearing flashdata
.
you can use following:
//in redirected to, controller constructor $this->session->keep_flashdata('message');
and see if flashdata
displayed, if yes, above statement correct.
Comments
Post a Comment