There are 4 MT3D templates where comments can be entered and edited. None of them properly save, delete, and retrieve cookies relating to comment forms:
Individual Entry Archive template:
- rememberMe() function sets site-wide cookies (path='/'), but forgetMe() function deletes cookies for directory archive page is on (path='').
Comment Listing template:
- Both rememberMe() and forgetMe() functions set and delete cookies for same directory archive page is on (path='').
Comment Preview template:
Comment Error template:
I'm not sure if it is best to use site-wide cookies or cookies that are specific to each archive directory. On my site, I wanted a single cookie that would remember the name / e-mail / URL info on every archive page, no matter what directory the page was in. The code I have provided below will set, delete, and retrieve site-wide cookies.
All that remains is to test the new templates and see if cookies are now read, set, and deleted correctly on the comment pages of your weblog. Hopefully, they will.
Update 02-Jun-2004: Jeroen notes in the comments that not everyone should use "/" to set a site-wide cookie:
Please note that this script sets the cooky for the root '/'. This works perfectly for sites that have its own domain (example.com), but if you share a server (example.com/user) you'll need to change the functions rememberMe and forgetMe to '/user', so they set the cookie for your site only.
This sounded like a good idea to me, so I've modified the remeberMe() and forgetMe() functions to use the <$MTBlogRelativeURL$> tag for the path instead of hard-coding it to '/'. This way, the script will automatically adjust the path for blogs that are not at the root of a domain.