• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Session class documentation does not explicitly state that Active Record must be activated

I pulled my hair out for 3 hours with this, thanks to user 'hammi' in #codeigniter IRC for helping me out.

I was trying to get the Session class to work with Postgres. No matter what settings I used, the first time you loaded a page a session would be created, then each page after would be blank. No warnings or errors displayed or in any log file (CI or Postgres or anything). If you cleared browser cookies, it would then reload once and display the page, add a new record to the DB, and then be blank for each page thereafter.

I went line by line in the Session class and discovered that it crashed here:

201. $this->CI->db->where('session_id', $session['session_id']);

YOU HAVE TO HAVE ACTIVE RECORD TURNED ON! I turned it off because I planned on writing straight SQL for speed, but it MUST be turned on!

Immediate Solution: Add "Active Record must be enabled" to the Session class documentation immediately, and possibly the Database configuration documentation as well.

Long Term Solution: Write code that accesses the DB in the session class without using active record if active record is turned off.

[eluser]Derek Allard[/eluser]
Sorry to hear this cost you time. If you wanted to help out, file a bug, or better yet, add that line into the userguide on bitbucket and make a pull request.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.