Welcome Guest, Not a member yet? Register   Sign In
Session serialized data... kinda? Dont understand the format
#3

(08-20-2015, 12:55 AM)Narf Wrote: It's Base64-encoded, not encrypted - there's a big difference.
And it is "fully serialized", just not via the serialize() function.

session_decode() can be used to unserialize the data, but that function puts the result directly into $_SESSION instead of returning it, and that's a quite big issue ... you don't want that; you should look for another way to do what you're trying to do.
Just add a user_id INT DEFAULT NULL field to the session table and update it on login, don't look for a complicated solution.

Subtle but important details like these are the reason I suggested (in the other thread) that you don't try to deal with the low-level drivers' code. You don't know how a session works internally and therefore you shouldn't be messing with it.

I would MUCH rather put a single column in the ci_sessions table, I thought you were against that initially...

And if its encoded and not encrypted, then I would think base64decode would work, using the following:

PHP Code:
log_message('error','DECODED DATA: ' print_r(base64_decode($session_data), TRUE)); 

   

That doesnt work, obviously.

You dont like that im trying to get it from the session data... which I dont get. Im not messing with the data as far as CI is concerned, im just intercepting it to read it, and passing it as it is back to CI... as far as CI is concerned, it never gets changed. Im hardly even messing with the framework. I just create theĀ MY_Session_database_driver::write method to read the params, then pass the data EXACTLY as it is given, to the CI_Session_database_driver::write method, so whats the big deal? (Ps, if any of that sounded rude, sorry, im not trying to come off that way, just dont get why you are so uptight that im doing this)
Reply


Messages In This Thread
RE: Session serialized data... kinda? Dont understand the format - by jLinux - 08-21-2015, 10:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB