How do I automatically delete flash_data message after it appears in codeigniter



  • elseif($aulas_professor[0]['controle_aula'] == 0){
       $desativado = $this->session->set_flashdata('desativado', "O Professor selecionado Não está ativado ,ative-o e tente novamente!");
       return $this->calendario($desativado);
    } 
    


  • It's not necessary. A https://www.codeigniter.com/user_guide/libraries/sessions.html?highlight=session#flashdata informs that this type of data is self-destruct (Then extracted from the documentation, in free translation):

    CoedIgniter supports "flashdata", or session data that are only available for the next request and will be automatically deleted.

    If you are using the method set_flashdata()from the session library to mark, you no longer need to do anything to erase that data.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2