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

#1
[eluser]seibelj[/eluser]
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:

Code:
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.


Messages In This Thread
Session class documentation does not explicitly state that Active Record must be activated - by El Forum - 04-15-2011, 12:32 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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