Level 11
@clarkeylogic You just need to unserialize it and you should be good to go.
public static function getChannelFromSession($session)
{
$payload = unserialize(base64_decode($session->payload)); // At this point you have an array
return $payload['channel'];
// If you want an object instead, you could typecast it to a stdObject.
// $payload = (object) unserialize(base64_decode($session->payload));
// return $payload->channel;
}
3 likes