![]() |
Flashdata don't show up - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Flashdata don't show up (/showthread.php?tid=69669) |
Flashdata don't show up - sabimofler - 01-03-2018 Hello everyone, I am having issues with flashdata. For some reason any of them won't show up. I am setting it like this: Code: // Controller Code: // View These are the configurations: $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = NULL; // $config['sess_save_path'] = sys_get_temp_dir(); $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = FALSE; $autoload['libraries'] = array('database', 'email', 'form_validation', 'session'); Any help is very appreciated. Thank You! RE: Flashdata don't show up - InsiteFX - 01-03-2018 You need to set your session path directory, this is how I do it. Create a new directory under your ./application directory called writable. Then set your session save path to this. PHP Code: $config['sess_save_path'] = APPPATH.'writable'; This works fine for me. RE: Flashdata don't show up - sabimofler - 01-03-2018 The sessions are being saved to the folder but flashdata are still not showing up. ![]() ![]() RE: Flashdata don't show up - XtreemDeveloper - 01-03-2018 You can set flash session message using this line $this->session->set_flashdata('success_message', 'Csv Data Imported Succesfully'); And you can Retrieve Flash session message using this line <div class="alert alert-success successMessage">' . $this->session->flashdata('success_message') . '</div> and $this->load->library('session'); Also updated these lines in cofig.php file $config['sess_driver'] = 'database'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = 'ci_sessions'; $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = FALSE; RE: Flashdata don't show up - Wouter60 - 01-03-2018 You forgot the echo command. Try: PHP Code: <p class="alert alert-danger"><?php echo $msg;?></p> Or with the shorthand notation: PHP Code: <p class="alert alert-danger"><?= $msg;?></p> RE: Flashdata don't show up - sabimofler - 01-04-2018 OMG, thank you Wouter60 ![]() |