I am using codeigniter , in my controller i can not set the flashdata , but i can set the user data
/**
* this will send the requests for the gmail wrapper
* @return void
* @author Sandaruwan
* */
function send_contacts()
{
$contacts = $this->input->post('contact');
if (count($contacts) != 0 && is_array($contacts))
{
$data = $this->gmailmanager->send_messeges($contacts);
echo "error message ===>"; print_r($this->message->get_message ()); echo "<br/>";
$this->session->set_flashdata('message',$this->message->get_message ());
echo "flash data ===>"; print_r($this->session->flashdata('message')); echo "<br/>";
$this->session->set_userdata('user',$this->message->get_message ());
echo "user data ===>"; print_r($this->session->userdata('user')); echo "<br/>";
exit;
redirect('connections/connection_inviter/invite');
}
else
{
$this->message->set_information(array(_('You have not selected a conatact!')));
$this->session->set_flashdata('message',$this->message->get_message ());
redirect('connections/connection_inviter/invite');
}
}
this is the result
error message ===>
Warning
Email sending error!
flash data ===>
user data ===>
Warning
Email sending error
!
the problem is i can get the error message
and userdata
but can not get the flashdata
, i can not figure out why i can not get the flashdata
right after initialized .
in some controllers flashdata works perfectly .
UPDATE
function invite() {
$this->load->library("connections/Outlookmanager");
print_r($this->ci->session->flashdata('message'); die;
//Invite friends links
$this->data['is_windows']=$this->outlookmanager->is_windows_user();
$this->load->view('connections/invite_friends', $this->data);
}
when i print flashdata
in function invite()
it is not printing .
UPDATE
hmmmm . actually there is a very interesting issue ,
i had the error message Email sending error
i changed it to err
now flash data working . i again changed message to Email sending error
and it is again not working . then i again changed it to err
then again flashdata works .
what is this , i think error message length is causing the problem here , and i don't know why