Welcome Guest, Not a member yet? Register   Sign In
Storing object in a session
#4

[eluser]gtech[/eluser]
Code:
<?php
class foo
{
  function foo(){
    $this->vartest = "hi";
  }
}

class Temp extends Controller {

  function Temp()
  {
    parent::Controller();
  }
  function index()
  {
      $resobj = new foo;
      $newdata = array('resobj' => $resobj);
      $this->session->set_userdata($newdata);
  }
  function page2()
  {
      $retobj = $this->session->userdata('resobj');
      print_r($retobj);
  }
}
?>

the above works for me (I also autoload session) I don't know if the code helps you.


Messages In This Thread
Storing object in a session - by El Forum - 06-07-2008, 09:52 AM
Storing object in a session - by El Forum - 06-08-2008, 06:58 PM
Storing object in a session - by El Forum - 06-09-2008, 05:32 AM
Storing object in a session - by El Forum - 06-09-2008, 05:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB