I have set the flash data like this
$this->session->set_flashdata('dispMessage','my message is here'));
I found that message in session library but not display in redirect page. and I am use the codeigniter version 2.2.0.
Can anyone help...?
According to the session class page of the manual:
CodeIgniter supports "flashdata", or session data that will only be available for the next server request, and are then automatically cleared. These can be very useful, and are typically used for informational or status messages (for example: "record 2 deleted").
Try preserving the flashdata in your script immediately prior to redirecting as follows:
$this->session->keep_flashdata('dispMessage');
// Set flash data
$this->session->set_flashdata('dispMessage', 'This is my message');
// After that you need to used redirect function instead of load view such as
redirect("yourcontroller/controllermethod");
// Get Flash data on view
$this->session->flashdata('dispMessage');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With