Welcome Guest, Not a member yet? Register   Sign In
getFlashdata is not clearing the message
#1

I am using codeigniter4 and uses the following code

In the controller -

$this->session->setFlashdata('success','Your  Data is saved'); 
return view('dashboard');

In the View
               <?php if (session()->get('success')): ?>
                  <div class="alert alert-success" role="alert">
                    <?= session()->getFlashdata('success'); ?>
                  </div>
                    <?php endif; ?>
                  </div>   



As per  code igniter 4 , this flashdata should clear . But flashdata shows in the second page also . Then it clears on the third page .
Reply
#2

If you echo the view instead of returning the view doe's it still do it?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(11-13-2020, 01:09 AM)InsiteFX Wrote: If you echo the view instead of returning the view doe's it still do it?

it is the same issue with the echo view
Reply
#4

Echo view also does the same issue
Reply




Theme © iAndrew 2016 - Forum software by © MyBB