![]() |
CI session library BUG? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: CI session library BUG? (/showthread.php?tid=19663) Pages:
1
2
|
CI session library BUG? - El Forum - 06-15-2009 [eluser]vps4[/eluser] /* Location: ./system/libraries/Session.php */ line: 270-282 Code: if (count($custom_userdata) === 0) AND http://ellislab.com/codeigniter/user-guide/libraries/sessions.html Code: CREATE TABLE IF NOT EXISTS `ci_sessions` ( the bug is: Code: user_data text NOT NULL Code: $custom_userdata = ''; this line will get error: Code: $this->CI->db->update($this->sess_table_name, array('last_activity' => $this->userdata['last_activity'], 'user_data' => $custom_userdata)); How can I fix it? change database table to : Code: user_data text NULL OR modify /* Location: ./system/libraries/Session.php */ like: Code: if (count($custom_userdata) === 0) CI session library BUG? - El Forum - 06-15-2009 [eluser]Dam1an[/eluser] I think this was a delibrate assumption, that you would only need the database to store session data if you a) have lots of session data b) Need some sort of security, track if a user is logged in, user_id etc With your second suggested solution, would that not cause problems trying to fetch the data, as it doesn't exist, so it would deserialize a null query? CI session library BUG? - El Forum - 06-15-2009 [eluser]TheFuzzy0ne[/eluser] That field should never be NULL anyway, as it should contain data pertaining to the session, such as ID, last activity, user agent and so on. An empty string is NOT NULL, so I don't see the problem. CI session library BUG? - El Forum - 06-15-2009 [eluser]Dam1an[/eluser] Actually, the CI session data (ID, last activity, user agent and IP address) all have dedicated field, but you make a valid point with the empty string not being null CI session library BUG? - El Forum - 06-15-2009 [eluser]TheFuzzy0ne[/eluser] You're right. Sorry, that was a bit of an oversight on my part. CI session library BUG? - El Forum - 06-15-2009 [eluser]vps4[/eluser] [quote author="Dam1an" date="1245083324"]I think this was a delibrate assumption, that you would only need the database to store session data if you a) have lots of session data b) Need some sort of security, track if a user is logged in, user_id etc With your second suggested solution, would that not cause problems trying to fetch the data, as it doesn't exist, so it would deserialize a null query?[/quote] I just ask for solution, i have not fix it... CI session library BUG? - El Forum - 06-15-2009 [eluser]TheFuzzy0ne[/eluser] What error are you getting? To my knowledge this is not a bug. CI session library BUG? - El Forum - 06-15-2009 [eluser]vps4[/eluser] [quote author="TheFuzzy0ne" date="1245110298"]What error are you getting? To my knowledge this is not a bug.[/quote] I run redux_auth the error: Code: A Database Error Occurred CI session library BUG? - El Forum - 06-15-2009 [eluser]Dam1an[/eluser] Are you using redux auth 1.4 or 2? As they both have differant schemas for the sessions table 1.4 doesn't have a field for userdata which is wierd :S CI session library BUG? - El Forum - 06-15-2009 [eluser]TheFuzzy0ne[/eluser] So the problem is with Redux and not CodeIgniter? |