CI 3.0 is losing Session always |
Hello, I have started a web site with CI 3.0, but I am with a problem with storing session.
I create the session example: PHP Code: $newdata = array( But in refresh, every sessions has removed. My config: PHP Code: $config['sess_driver'] = 'database'; My autoload PHP Code: $autoload['libraries'] = array('database', 'session');
You should remove session from the drivers autoload since it's a library. When you say it's removed, do you mean it's not in the DB or when you try to use $this->session->userdata( 'username' ) you don't get the expected value?
I removed the autoloaders.
But in a example, controller Login I create de session, and still I can't show the session using: $this->session->userdata( 'username' )
Did you create the table: "ci_session" in your database?
Depending on your DB drive, the file structure is different. Lots of information in the 3.0 User Guide: file:///home/twp/Dev/CI3.0/user_guide/libraries/sessions.html#database-driver Check that your app configuration meets the three conditions stated at the top of section on the database session driver. Second paragraph: Quote:
Yes, i created the table and it is works!
That's ok now, was a problem with logout() in a librarie. Thanks |
Welcome Guest, Not a member yet? Register Sign In |