src/Cookie.php
public static function fromJson(
        string $name,
        bool $endsWithSession,
        DateTimeImmutable $issuedAt,
        string $json
    ) : self {
        $cookie = new self($name, $endsWithSession, $issuedAt);
        $cookie->data = json_decode($json, true);

        if (! is_array($cookie->data)) {
            throw JsonException::fromJsonDecodeError(json_last_error_msg());
        }

        return $cookie;
    }
public static function fromJson(
        string $name,
        bool $endsWithSession,
        DateTimeImmutable $issuedAt,
        string $json
    ) : self {
        $cookie = new self($name, $endsWithSession, $issuedAt);
        $cookie->data = json_decode($json, true);

        if (! is_array($cookie->data)) {
            throw JsonException::fromJsonDecodeError(json_last_error_msg());
        }

        return $cookie;
    }
public static function fromJson ( string $ name , bool $ endsWithSession , DateTimeImmutable $ issuedAt , string $ json ) : self { $ cookie = new self ( $ name , $ endsWithSession , $ issuedAt ) ; $ cookie -> data = json_decode ( $ json , true ) ; if ( ! is_array ( $ cookie -> data ) ) { throw JsonException :: fromJsonDecodeError ( json_last_error_msg ( ) ) ; } return $ cookie ; }
Creates a new cookie instance from JSON encoded data.

This is primarily used by the `TokenManager` to unserialize a cookie from a JWT token.

@throws JsonException When an error occurs during decoding
Creates a new cookie instance from JSON encoded data .