in reply to cookies are not set consistantly

Rather than sitting around hypothesizing about the possible results of your program, the best approach would be to actually view the headers that the program is sending.

Regarding your code, there is absolutely no reson to use CGI::Cookie when you are already using CGI.pm. the -cookie attribute of the header method of CGI expects a simple text version of the cookie and is meant to work with CGI->cookie().

-caedes