I'm looking for way to remove all my web cookies which have similar name "SID12345UID123456789" , all have SID and UID in their name ..
it can be done by jquery or pure JavaScript thanks for any advices
Update: worked base on other script i made this one it work but simple with indexOf .. i know some one can do better by regex match .. please help
var cookies = document.cookie.split(";");
for(var i=0; i < cookies.length; i++) {
var equals = cookies[i].indexOf("="),
name = equals > -1 ? cookies[i].substr(0, equals) : cookies[i];
if ( name.indexOf('SID') > 0 && name.indexOf('UID') > 0 ){
alert(name);//for test
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
}
}