Please take a look at the following code:
$this->session->set_flashdata('message', 'This is a message.');
var_dump($this->session->flashdata('message'));
It returns bool(false).
I hope it doesn’t NEED a redirect() to be recallable after that, because some times I need to call it right after setting the flashdata in a view.
Edit after venkat‘s comment
$this->session->set_flashdata('message', 'This is a message.');
$this->session->keep_flashdata('message');
var_dump($this->session->flashdata('message'));
No difference unfortunately.
Well, the documentation does actually state that
as the very first thing, which obviusly means that you need to do a new server request.
A redirect, a refresh, a link or some other mean to send the user to the next request.
Why use flashdata if you are using it in the same request, anyway? You’d might as well not use flashdata or use a regular session.