I'm not really sure what the problem is. I can see that you have lifted the code from a Microsoft sample application though. In the Microsoft sample, they use SetCookie rather than AppendCookie. However I'm not sure whether this is significant. Is the code actually falling over on this line, or it it failing in TranslateCookie?
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush