Xymon Mailing List Archive search

Chrome cookie deprecations (fix/workaround)

list Schminke_Erik_D
Mon, 18 Jun 2018 15:20:01 -0500
Message-Id: <user-90fb1eccfdae@xymon.invalid>

Hi All,

I wanted to share my fix/workaround for the "Chrome cookie deprecation".

Put the following code above the closing body tag in the
$XYMONHOME/web/stdnormal_footer template file.

<script type="text/javascript">
    var metas = document.getElementsByTagName('meta');

    for (var i=0; i<metas.length; i++) {
        var type = metas[i].getAttribute("HTTP-EQUIV");
        if (type == "Set-Cookie") {
            var prop = metas[i].getAttribute("CONTENT");
            document.cookie = prop;
        }
    }
</script>

Chrome has disabled, as a security measure, the ability to set cookies
using HTML tags.  Xymon (as of v4.3.27) relies on HTML cookies to allow a
user to go from a particular page of monitored hosts to either the
"Acknowledge alert" or "Enable/Disable" pages and, based on the origin,
filter the hosts/alerts for that page.  I've noticed it, as have a few
others in the Xymon community.  This should get us by until a permanent fix
can be implemented in a release version.


Erik D. Schminke | Associate Systems Programmer
Hormel Foods Corporation | One Hormel Place | Austin, MN XXXXX
Phone: (XXX) XXX-XXXX
user-15513f33c451@xymon.invalid | www.hormelfoods.com