[eluser]KJTED[/eluser]
[quote author="walesmd" date="1189716612"]
Quote:Once more the CodeIgniter documentation is letting me down. It explains how to add custom session variables but doesn’t actually tell you how to access them once you create them. It’s starting to really get to me
Uhm... yes it does. The fourth header in the documentation reads "Retrieving Session Data".
Quote:Any piece of information from the session array is available using the following function:
Code:
$this->session->userdata('item');
Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you will do this:
Code:
$session_id = $this->session->userdata('session_id');
Note: The function returns FALSE (boolean) if the item you are trying to access does not exist.
[/quote]
No it doesn't. It shows you how to add an array of additional information to the session, but doesn't show you how to access elements of that array from the additional information. Or am I just reading it all wrong?
I'm thinking that because PHP is intantial then the next time I access a method of that class the class variables are reinitialised back to their default values, hence the inability to store information in them... session variables would seem to be the best alternative then.