Welcome Guest, Not a member yet? Register   Sign In
Session Problem CI2.0

I use CodeIgniter and save Sessions in my DB.

The following line of code will be executed if the users try to login and the login is successfull (found his data in the db):

$this -> session -> set_userdata($account_data); /login-page

After this i redirect the user to my dashboard. The dashboard tries now to read the $account_data from the session. BUT

$this -> session -> all_userdata(); /dashboard

outputs only the standart session content from codeigniter. I check the session after the set_userdata call (above) and the array is loaded. But there is no db-entry for this session. Ok i call the all_userdata(); in the dashboard - it shows the standart content of the session AND a the data is saved in my db.


LoginPage - Load some Accountdata and save it in a Session. I can load the Accountdata from this session. NO db-entry

Dashboard - Session contains only the standart content of codeigniters session. DB-Entry with this data exists.

Only at the beginning of the LoginPage i destroy the session.

I'm a little bit confused, it seems the session is not "transported" to the next site.

Any tips?

Edit: Test-Case
public function testSessionStart(){
           if ($this->session->userdata('key')){


            echo "<br><a href='".base_url()."login/testSessionEnd'>Klick me</a>";

        public function testSessionEnd(){

If the Start func is called, the db never get's an entry. End func generates a new Session and save it to the db. i have no idea why

Theme © iAndrew 2016 - Forum software by © MyBB