I don’t know whether it’s a bug or what.
I would store a object in session sometimes, like this.
$this->session->set_userdata('session_name', $object);
It will cause error messages like this:
A PHP Error was encountered
Severity: 4096
Message: Object of class stdClass could not be converted to string
Filename: libraries/Session.php
Line Number: 715 When I digged into 1.7 Session library, I found the problem.
Fixed a bug in the Session class that was disallowing slashes in the serialized array.There are some new functions in Session library.
GOTO line 683 and line 714,
$data[$key] = str_replace('', '\\', $val);
if(!is_object($val)) $data[$key] = str_replace('', '\\', $val);
Hope there will be a hotfix soon.
I also made my own hotfix for this problem.
I made a session_fix library extends the original Session library,
only overrides these two functions.
Get my code from here and put it into /system/application/libraries/Session_fix.php
Load this library with a CI 1.7 new feature:
$this->load->library('session_fix', '', 'session');