Can't unset session variable - 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: Can't unset session variable (/showthread.php?tid=48928) |
Can't unset session variable - El Forum - 02-02-2012 [eluser]Unknown[/eluser] I have a function that deletes a file and then attempts to unset it from a session variable like so Code: function removePrescription($id, $item) The function removes the file okay but when it tries to unset the session variable I get this error. Undefined property: CI_Session::$unset_userdata Does anyone know what I'm doing wrong? Thanks for any help! Can't unset session variable - El Forum - 02-02-2012 [eluser]Jason Stanley[/eluser] You aren't using the session library as intended. Typically you call the set_userdata function. You appear to be specifying a class variable. You want to do something like this. Code: $details = $this->session->userdata('prescription_details'); Can't unset session variable - El Forum - 02-02-2012 [eluser]Unknown[/eluser] Ah, I get it now. Cheers bud! |