Welcome Guest, Not a member yet? Register   Sign In
[Resolved] 1.7.0 Session Woes - Array Data Help
#1

[eluser]Randy Casburn[/eluser]
1.7.0 Session Library breaks my code that stores array in the session...

Given this snippet:

Code:
// code to retrieve $uri  
   .
   .
   .
$page = array();
$page[$page_name] = base_url().ltrim($uri,'/');
// Store the $page cookie trail into the session
$this->session->set_userdata('trail', $page);

This fails with the error reported here.

I know I must be doing something stupid. This worked flawlessly in 1.6.3 ... broken in 1.7.0.

I know this is breaking in the _serialize / _unserialize functions.

Thanks for the help,

Randy
#2

[eluser]Randy Casburn[/eluser]
REF: New Session Library

NOTE: "custom_userdata" does not support data compacted & type casted to objects.

If your current app uses them in your stored sessions the new library will break your app.

i.e.
Code:
$data = (object) compact('a','b','c','d');
$this->CI->session->set_userdata('myData', $data);

This worked in 1.6.3. 1.7.0 now walks the data and performs string manipulations on key/value pairs within the custom_userdata. This fires a fatal error when attempting to convert a stdObj type to a string.


Randy




Theme © iAndrew 2016 - Forum software by © MyBB