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

(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 complicate
PHP Code:
private function _assoc_session($account_id$session_id)
 
   {
 
       return self::$db
            
->where'id'$session_id )
 
           ->update('ci_sessions', ['account_id' => $account_id]);
 
   
d 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.

Alright, I just ended up doin it your way.
Reply


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



Theme © iAndrew 2016 - Forum software by © MyBB