Session lost after redirect |
I need help for this issue:
Code: function login_validation() { Te issue is I lost all my session vars after the redirect, in function login_validation the value printed is correct but in function dashboard no. My config file is: Code: $config['sess_driver'] = 'database'; Any Ideas? I'm desperate. Thank you in advance.
Autoload the session library
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(05-03-2017, 12:27 PM)InsiteFX Wrote: Autoload the session library Thank you for your response. I have read all the posts related to this issue but I cannot find any solution. Code: $this->session->set_flashdata('session_nickname', 'some message'); but in the dashboard function after getting values from session it prints an empty string. I hope to solve this issue Thank you
Some ideas:
Check the log for any info. Try it with the session set to the default file system instead of the database.
Simpler is always better
I am sorry, I forgot to say that I tried with file sessions instead of database sessions. I got the same result.
If multiple redirects then you will need to use keep_flashdata()
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
do login_validation and dashboard belongs to same class? would you show us your controller class?
God Bless CI Contributors
You'd don't need to execute " $this->load->library('session');" twice. Put it in the controller's constructor. Make sure you call parent::__constructor() first. If using autoload then don't call it at all.
Simpler is always better
|
Welcome Guest, Not a member yet? Register Sign In |