[eluser]Unknown[/eluser]
trying to get a mental grip on how flashdata works.
with this controller (session loaded by autoload.php):
Code:
<?php
class Flashtest extends CI_Controller {
function __construct() {
parent::__construct();
}
public function index() {
$this->session->set_flashdata('message', 'session data set');
$this->load->view('view_flashtest');
}
}
and this view
Code:
<html>
<head><title>flashtest</title></head>
<body>
<div>
============================<br/>
<?php echo $this->session->flashdata('message'); ?><br/>
============================<br/>
</body>
</html>
I don't get the message displayed until I refresh the page.
Why? Shouldn't the flashdata display when the view loads (without a page refresh)?