Welcome Guest, Not a member yet? Register   Sign In
Session destroing flashdata

Hi guys, i'm brazilian, and sorry about my english.

Ok, let's go to the problem:

I'm trying to make a logoff button, and when a user click in logoff, i call the function logoff:

function logoff(){
        $this->session->unset_userdata(array('user_id', 'user_nome', 'user_admin', 'user_logado'));
        set_msg('logoff', 'Logoff efetuado com sucesso.', 'sucesso');

but, when i destroy the session, i can't create a new one to display the message that was set in 'set_msg' function.

I've two function in my helper to display it:

function set_msg($id = 'msgerro', $msg = NULL, $tipo = 'erro'){
    $CI =& get_instance();
        case 'erro':
            $CI->cookies->set_flashdata($id, '<div class="alert-box alert radius">'.$msg.'</div>');
        case 'sucesso':
            $CI->session->set_flashdata($id, '<div class="alert-box sucess radius">'.$msg.'</div>');
            $CI->session->set_flashdata($id, '<div class="alert-box radius">'.$msg.'</div>');

//Verifica se existe uma mensagem para exibir na tela atual.
function get_msg($id, $print = TRUE){
    $CI =& get_instance();
    $flash = $CI->session->flashdata($id);  THAT VALUE WAS COMING NULL BECAUSE OF SESSION DESTROY.
            echo $flash;
            return TRUE;
            return $CI->session->flashdata($id);

Make sense?
Someone have a hint to give me, how to fix this problem?

My CI version is 3.0.3
in old versions, people type $this->session->create(); and it's work very well..

Heelp me!

Messages In This Thread
Session destroing flashdata - by Underzzoo - 11-09-2015, 05:23 PM
RE: Session destroing flashdata - by skunkbad - 11-09-2015, 07:06 PM
RE: Session destroing flashdata - by CroNiX - 11-12-2015, 05:19 PM

Theme © iAndrew 2016 - Forum software by © MyBB