locked
Need to remove entire cookie using java script RRS feed

  • Question

  • User86716463 posted

    Deal All,

    I am using below code for remove cookie.. But Its not worked out ..

    var cookies = document.cookie.split(";");

    for (var i = 0; i < cookies.length; i++) {
    var cookie = cookies[i];
    var eqPos = cookie.indexOf("=");
    var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
    document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
    }

    Please help me on this..

    Thanks in Advance..

    -- Ramesh

    Thursday, September 28, 2017 12:08 PM

All replies

  • User753101303 posted

    Hi,

    Coild it be that you try to change a HttpOnly cookie (httponly tells the browser it shouldn't be changed or even maybe read through JavaScript).

    Thursday, September 28, 2017 12:20 PM