Read More: blog.mageprince.com
\Magento\Framework\Serialize\Serializer\Json class for serialize and unserialize values.
public function __construct(
$this->serialize = $serialize;
$value = $this->serialize->unserialize($serializeData);
As per Magento 2.2 Release Note
In general, we’ve removed serialize/unserialize from most the code to improve protection against remote code execution attacks. We’ve enhanced protection of code where use of object serialization or unserialization was unavoidable. Additionally, we’ve increased our use of output escaping to protect against cross-site scripting (XSS) attacks.