session flashdata not work correctly in codeigniter 2.2 |
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();
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
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?
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.
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
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?
Btw, have you installed (our new friend) mycrpyt on your server (phpinfo() will tell you about). In CI 2 you will need it.
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. |
Welcome Guest, Not a member yet? Register Sign In |