I run a blog (in blogger/blogspot). I need help placing a cookie on a visitors computer. Also I need help on placing information on that certain cookie. To be more exact of what I want to do. When a visitor clicks an external link (api.viglink) a cookie is placed with some info in it. How can I place my own cookie with the info that I want in it?? Please be descriptive with your solutions. Not just code
If you are able to run JavaScript:
function setcookie(name, value, exp) {
var today = new Date();
var expires = new Date();
var ndays = 1;
var path = '/';
var domain = 'yourdomain.blogger.com';
var secure = false;
var val = escape(value) || "";
exp = (exp == -1) ? true : false;
if (exp) {
expires.setDate(today.getDate() - 1)
} else {
if (ndays == null || ndays == 0) ndays = 1;
expires.setTime(today.getTime() + 3600000 * 24 * ndays)
};
document.cookie = name + "=" + val + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "")
}