[eluser]pmhart[/eluser]
Hello,
I am setting up a submission process, after a simple submission the user can add additional data if they'd like to a song tab.
Here is the brief of my code:
controllers/submit.php
Code:
...
function tab() {
$step = $this->uri->segment(3);
...
}else if($step == "save") {
$obj->null;
$obj->title = $this->input->post("title");
$obj->artist = $this->input->post("artist");
$obj->tab_body = $this->input->post("tab_body");
$submission_id = $this->submissionModel->create($obj);
$obj->submission_id = $submission_id;
$this->securityservice->set_var("last_submission", $obj);
//LOCATION A
//debug here
$submission_obj = $this->securityservice->get_var("last_submission");
print_r($submission_obj);
//commented out to use print_r, should ideally redirect
//redirect("/submit/tab/completed");
}else if($step == "completed") {
//LOCATION B
$submission_obj = $this->securityservice->get_var("last_submission");
print_r($submission_obj);
}
...
}
..
}
...
libraries/securityservice.php
Code:
...
function set_var($name, $value) {
$this->session->set_userdata($name, $value);
return true;
}
function get_var($name) {
return $this->session->userdata($name);
}
function clear_var($name) {
$this->session->unset_userdata($name);
}
...
Ok ... so right after I insert into the session and grab the object from the session using the SecurityService library to a different variable, it will print_r the object as expected (see Location A in the code).
When I go to the completed page (by redirect or clicking a link), the object contains no properties, it just says "Object" (see Location B).
This has happened to me other times with the log-in script in which I stored the referring page URI.
Please help!