0

I am trying to display a success message every time someone login/logout/create post/delete post etc. At the beginning it didn't show on the screen and I changed a configuration in the session.php file that a lot of people suggested and the problem seemed fixed, but since then the messages don't go away even if I reload or go to another page.

This is the change I made in the session file ini_set('session.id', $params['cookie_name']);

This is in the header of my page in the views folder

<?php if ($this->session->flashdata('user_registered')) : ?>
            <?php echo '<p class="alert  alert-dismissible alert-success">' . $this->session->flashdata('user_registered') . '</p>'; ?>
        <?php endif; ?>

And this is in the controller

 $this->session->set_flashdata('user_registered', 'You are now registered and can log in');
slap
  • 1

0 Answers0