CI session library BUG? |
[eluser]vps4[/eluser]
/* Location: ./system/libraries/Session.php */ line: 270-282 Code: if (count($custom_userdata) === 0) AND http://ellislab.com/codeigniter/user-gui...sions.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)
[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?
[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.
[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
[eluser]TheFuzzy0ne[/eluser]
You're right. Sorry, that was a bit of an oversight on my part.
[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...
[eluser]TheFuzzy0ne[/eluser]
What error are you getting? To my knowledge this is not a bug.
[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
[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
[eluser]TheFuzzy0ne[/eluser]
So the problem is with Redux and not CodeIgniter? |
Welcome Guest, Not a member yet? Register Sign In |