Welcome Guest, Not a member yet? Register   Sign In
CI v1.5.4 Session question

Hey everyone, I am quite new to CI and have inherited a large Oracle implementation that uses a very old version of CI (a dump of the CI_VERSION= 1.5.4) to which i cannot find documentation for at all. It looks like the version i am forced into isn't even a stable release?

The problem is my hands are tied with regards to upgrading this to new version and the project itself goes EoL in a year. However I have been tasked with a change that requires me to dig in deep. 

What I am trying to do is simply get a list of all of the CI session variables that are in play. It seems that around CI v2 they implemented a much easier way to do this in the session.php file with the added function all_userdata() as well as store the CI variables in the $_Session php object. In my current attempts I have tried to dump out $_Session which is empty, i have also tried with not much luck to extend the current session class with a newer version of session.php in the hopes i can just get the variables to dump out once.(I do not have permissions to modify the current session.php or I would just stuff the all_userdata function in there for a 1 time dump) I really just need the name of the key so that i can fetch it later. I have 3 variables that are being passed through, and i have 'guessed in the dark' at the first 2 keys and got lucky. However i cannot for the life of me figure out what they used for the third one.  

My problem is really that the core code is read only and buried in an oracle stack with most of my permissions limited. I can modify files at the top end of the stack, but the core architecture is off limits (requests for access denied and not owned by me).

Im really hoping someone has a way to just list out the current CI userdata, im ok with hacky solutions because the data IS coming back when i use the getSessionData($key) function with a correct key.

anyways, cheers all, hopefully someone remembers back this far in history and has a solution. If not, thanks for taking the time to read this.

Wow - that version predates even my exposure to CodeIgniter (1.16?) ... it must be over 10 years old Undecided
I hope there are some oldtimers here who can shed some light on the v1 sessions for you!

(This post was last modified: 12-18-2018, 09:47 AM by InsiteFX.)

You cannot even download it any more all of those versions have been deleted from EllisLabs,

I have all the versions from 2.1.0 to 3.1.9 and 3.2.0 developers version.

Below 2.1.0 good luck trying to find it.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

(This post was last modified: 12-18-2018, 12:28 PM by dave friend.)

To the best of my knowledge the PHP superglobal $_SESSION was not used until CI version 3.+. Prior to that, all session data was stored in the session cookie. That was the case for v2.x.x of CodeIgniter and I assume that was also the case for v1.x.x.

One thing you can try. Back in the early Session class the session data was held in a public property named "userdata". It was quite literally an associative array structured exactly the same way as PHP's  $_SESSION. So you should be able to
PHP Code:
at the point where you expect all the pieces you need to be in place and see what the variables in play actually are.

Thanks everyone for the feedback, I have tried your suggestion Dave, and I do believe that in the original 1.x version, 'userdata' was most likely the placeholder for the data i need. Unfortunately, i suspect the version of session.php i am using has been modified (i see some oracle fingerprints in here). All of the properties and methods have been set to private with the exception of one public getter and setter that require an index be sent in the caller.

I believe I have hit the end of the road on this request, and without access, my options are limited. I will be suggesting we migrate to a new version of CI, or at the very least, give me temporary access to dump out the session data for a one time view.

thanks again for taking the time

Hi Freja,

I have an unmodified copy of 1.7.2 if it can help you

A good decision is based on knowledge and not on numbers. - Plato


hi Salain, thank you for the offer, unfortunately I do not have access to modify or add to this layer of my stack. I have tried to place a session.php from CI 2.X (the oldest i could find on the GIT repo) in a dev branch that i do have write access as a last attempt at bypassing the current one to no avail. I was hoping that if i instantiated the new one and called getInstance() it would hook me in to the userdata from the original class but give me access to the data. I feel like this should work but i've not had any luck. I am still churning down this path today, however after that I will be kicking the story back to the backlog as it has increased in scope by a fair amount due to my restrictions.

Thanks again to all! By far one of the most helpful community's i have had the pleasure of joining.

Theme © iAndrew 2016 - Forum software by © MyBB