in reply to cookie problem

Cookies have a domain variable as well as a path variable which can be set. It determines a cookies' scope based on the path and/or domain you specify. Double check the values perl is setting. Lot's in the monk library for you on cookies.

When you are debugging, print your cookie ($ENV{'HTTP_COOKIE'}) so you can see the anatomy. This will show you what your script is printing. Here are some cookie prefs you may encounter: expires, path, domain, secure.

Of course a module would save you a world of time.