You need to sign in to do that
Don't have an account?
taradyn
Delete cookie based on id
I've created a cookie as shown:
I would like to delete the cookie data based on their productid. But not sure on how to do so. I've read the cookie class docs and found this:
maxAge
Type: Integer
A number representing how long a cookie is valid for in seconds. If set to less than zero, a session cookie is issued. If set to zero, the cookie is deleted.
How do I delete the data?
cookieJar c = new cookieJar(p.productid, selSize, selColour, String.valueOf(p.qtyToBuy));and append any newly added data to the cookie:
cookieJar c = new cookieJar(p.productid + ',' + pid, selSize + ',' + psize, selColour + ',' + pcol ,String.valueOf(p.qtyToBuy) + ',' + pqty);
I would like to delete the cookie data based on their productid. But not sure on how to do so. I've read the cookie class docs and found this:
maxAge
Type: Integer
A number representing how long a cookie is valid for in seconds. If set to less than zero, a session cookie is issued. If set to zero, the cookie is deleted.
How do I delete the data?
Call this method on the "onload " event of the page--> onload="loaded();"
<!--add this code to html---><a href="javascript:deletecook();">Delete Cookie</a>