Welcome Guest, Not a member yet? Register   Sign In
Problems retreiving session data on View page
#3

(01-26-2015, 02:20 PM)CroNiX Wrote: You aren't using sessions properly when retrieving session data.

Code:
<?= ucwords($this->session->userdata[1]); ?>

Should be something like

Code:
<?= ucwords($this->session->userdata('field_you_stored_the_variable_as_in_session'); ?>

Like

Code:
$this->session->userdata('username');

If you don't use it as the userguide states, you will have problems (even if it "appears" to work in some cases)

Thanks but I don't want to store the data in an associative array, needs to be in a numeric array so that I can loop through the elements of the array using an index so I can put them into a table. Are you saying it's not possible to use a numeric array with session data?

The data from the old functionality was stored in an associate array, before I changed it to a numeric array so I could use the index variable with it for looping. But, I was having the same problems with the page needing to be refreshed before moving the data into a numeric array, and the data was all displaying fine for several hours after changing it to a numeric array. I see the docs only mentioning using an associative array, but are you sure it cannot be done with a numeric one?
Reply


Messages In This Thread
RE: Problems retreiving session data on View page - by user2374 - 01-26-2015, 02:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB