It is possible to set of edit (re-setting) a cookie for storing information during a vistor session.
Create a Custom Html Tag with the following code:
var cookieName = "nameOfTheCookie";
var cookieValue = "value";
var cookiePath = "/";
var expirationTime = 2628000; //For example one month in seconds (2628000)
expirationTime = expirationTime * 1000; //Convert expirationtime to milliseconds
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; //Set cookie
This wil look like:
Next step is setting a trigger when the trigger had to fire.
To read out the value of your cookie, you have to create a new 1st Party cookie variable.
The Cookie name is the name you have chosen by setting it. In my example it is nameOfTheCookie, but you have to change this to your own.
If you would like to retrieve te current value of your cookie you could make use of the EditThisCookie extension for Chrome.