in reply to Setting cookies on session data change

I can't really make out what that code is supposed to do, but I can see red flags all over the place: are you using strict, warnings and taint-mode?
#!/usr/bin/perl -wT use strict;
If not, do so now. It might point out some errors in your code.

Anyhow, you've got a variable called $sessionInfo, but as far as I can see, you're not actually using a session, and you just want put that info in the cookie. DON'T. Use CGI::Session or Apache::Session instead.

The docs for CGI::Session are pretty clear, so maybe you should start reading that.