session flashdata not work correctly in codeigniter 2.2 - 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: session flashdata not work correctly in codeigniter 2.2 (/showthread.php?tid=388) |
session flashdata not work correctly in codeigniter 2.2 - Smith - 11-27-2014 Hi guys!, can you help me? I have a problem with session flashdata. never the message containing the session is displayed. I have this routes: PHP Code: //index is a subfolder into the controllers folder user.php controller: PHP Code: public function showRegister() to display messages I do this in the view "login": PHP Code: <div class="alert alert-info alert-dismissible" role="alert"> But never the message is printed. i Tried this: PHP Code: $this->session->set_flashdata('info', 'test......'); But not works. Also add the favicon.ico to the root folder, but does not work. I'm trying to fix it a few hours ago. It may be the version of PHP? Also i tried this: PHP Code: $this->session->sess_create(); RE: session flashdata not work correctly in codeigniter 2.2 - ohiageorge - 11-28-2014 Can you change the name of the subfolder "index" in the controllers Folder to another name to something else like "member" and try again? I think CI is having problem interpreting the URL since it contains the "index" keyword RE: session flashdata not work correctly in codeigniter 2.2 - Smith - 11-28-2014 Hi ohiageorge, thanks for your reply. i changed name of subfolder "index" to "test" but not works. I tested everything and still not working. Can you think of anything else? RE: session flashdata not work correctly in codeigniter 2.2 - Rufnex - 11-28-2014 What are your session settings? RE: session flashdata not work correctly in codeigniter 2.2 - Smith - 11-28-2014 Hi Rufnex, thanks for your reply. you want to say? I cannot understand RE: session flashdata not work correctly in codeigniter 2.2 - Rufnex - 11-28-2014 In your /application/config/config.php there is a section "Session Variables". i want to check if there is all well done there. Btw .. do you load the session library? PHP Code: $this->load->library('session'); // or in your autoload.php What you do seams absolutly right. You can also try a simple test PHP Code: $this->session->set_flashdata('item', 'value'); Load this 2 or more times any you should see a filled array. RE: session flashdata not work correctly in codeigniter 2.2 - Smith - 11-28-2014 Hello again, I load library this way: autoload.php PHP Code: $autoload['libraries'] = array('form_validation','input','session','template','database','breadcrumbs'); Also i try loading the library on the builder, but not working. In my config.php file on Session Variables i have this: PHP Code: /* I Added the code you told me and I get this error: Quote:A PHP Error was encountered the "$key" variable refers to the constant encryption_key?. when i add this code: PHP Code: $this->session->set_flashdata('item', 'value'); this not print anything on screen. Again thank you for your response RE: session flashdata not work correctly in codeigniter 2.2 - Rufnex - 11-28-2014 Ups i think in CI 2 you must give flashdata() the property name as parameter. Have you also checked your cookie setting in the config.php? RE: session flashdata not work correctly in codeigniter 2.2 - Rufnex - 11-28-2014 Btw, have you installed (our new friend) mycrpyt on your server (phpinfo() will tell you about). In CI 2 you will need it. RE: session flashdata not work correctly in codeigniter 2.2 - Smith - 11-28-2014 Hi Rufnex, downloaded again CI and created a separate project. and working correctly. apparently i configured incorrectly config.php file. I never thought I was going to be that. I apologize for stealing so long. Thank you very much. |