Flashdata don't show up |
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!
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. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
The sessions are being saved to the folder but flashdata are still not showing up.
![]() ![]()
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;
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>
|
Welcome Guest, Not a member yet? Register Sign In |