Nah, I see why.
This is in your <script>:
CODE
var HOST = 'www.pocketfactory.com';
That means anyone who goes to www.pocketfactory.com will have cookie work perfectly. But anyone who goes to pocketfactory.com will NOT. Also, anyone who got a cookie using www.pocketfactory.com will not have it accessible to them if they go to pocketfactory.com.
This is why it only sometimes fails.
You can do a few things.
1) Redirect ALL requests from pocketfactory.com/* to www.pocketfactory.com/*. This is the best solution for many reasons, but many people have a bit of trouble figuring out the apache config file or .htaccess file.
2) change var HOST to 'pocketfactory.com'.
Also, you should probably set your cookie at the root of your website like so:
CODE
function rememberMe (f) {
var now = new Date();
fixDate(now);
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
setCookie('mtcmtauth', f.author.value, now, '/', HOST, '');
setCookie('mtcmtmail', f.email.value, now, '/', HOST, '');
setCookie('mtcmthome', f.url.value, now, '/', HOST, '');
}
function forgetMe (f) {
deleteCookie('mtcmtmail', '/', HOST);
deleteCookie('mtcmthome', '/', HOST);
deleteCookie('mtcmtauth', '/', HOST);
f.email.value = '';
f.author.value = '';
f.url.value = '';
}
That way, no matter WHAT directory the page with the comment form is, your user will have access to the cookie.