HI @jaimebupa
Pleasure, glad i could help.
To 'get rid of a cookie', you effectivly expire the cookie.
When setting it, set against a fixed time expiry, something long enough for the sequence, say 1 hour or so.
When the sequence ends you simply update the cookie time setting to 0 time or an earlier time period and this will expire the cookie.
The below code can also be used to drop a cookie using a javascript extention. Once you google your way to expert cookie knowledge, you will find that the below code can be reduced, based on your needs.
var cookieName = "give me a name";
var cookiePath = "/";
var cookieValue = ;//Populate a value, this can be from a variable, or a fixed variable
var expirationTime = 2628000; //For example one month in seconds (2628000)
expirationTime = expirationTime * 1000; //Convert expirationtime to milliseconds
var date = new Date(); //Create javascript date object
var dateTimeNow = date.getTime(); //Get current time in milliseconds since 1 january 1970 (Unix time)
date.setTime(dateTimeNow + expirationTime); //Set expiration time (Time now + one month)
var expirationTime = date.toUTCString(); //Convert milliseconds to UTC time string.
document.cookie = cookieName + "=" + cookieValue + "; expires=" + expirationTime + "; path=" + cookiePath; //This drops the cookie - to expiire the cookie you can set expires=Thu, 01-Jan-70 00:00:01 GMT
... View more