CodeIgniter Forums
Illegal offset type in unset (Session.php - Line 727) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19)
+--- Thread: Illegal offset type in unset (Session.php - Line 727) (/showthread.php?tid=61242)



Illegal offset type in unset (Session.php - Line 727) - luizzz - 04-03-2015

Got a lot of warnings in my log with:
PHP Code:
SeverityWarning --> Illegal offset type in unset C:\var\data\localweb\gv\system\libraries\Session\Session.php 727 
What is it?


RE: Illegal offset type in unset (Session.php - Line 727) - sv3tli0 - 04-03-2015

What do you try to unset from session ?
The Key must be string or array of strings. Its most likely that you have send either NULL or other type which can't be unset ..


RE: Illegal offset type in unset (Session.php - Line 727) - luizzz - 04-04-2015

(04-03-2015, 09:55 AM)sv3tli0 Wrote: What do you try to unset from session ?
The Key must be string or array of strings. Its most likely that you have send either NULL or other type which can't be unset ..

That's right.
Doing a $this->session->unset_userdata($data); where $data array contains keys that doesn't exist, throw this warning.

Thanks a lot! Big Grin