CodeIgniter Forums
tempdata not getting erased after given time - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forum-6.html)
+--- Forum: Issues (https://forum.codeigniter.com/forum-19.html)
+--- Thread: tempdata not getting erased after given time (/thread-71250.html)



tempdata not getting erased after given time - adil - 07-23-2018

hi,
iam using
$this->session->set_tempdata('messege', 'hi', 5); 
in my controller to set tempdata. and i used 
<div class="card-body">
               <?php ?>
                    <span style="color: red;"><?php echo $this->session->tempdata('messege'); ?></span>   
               <?php  ?>
                                  <div class="table-responsive">


to call tempdata.But its not geting erased after 5 seconds


RE: tempdata not getting erased after given time - dave friend - 07-24-2018

You mean that the displayed message is not erased after 5 seconds? That would require additional code probably javascript to accomplish. tempdata will be removed from the session user data but that has no bearing on data that is already displayed.