While red tape is uncool, we're stuck with the current state of affairs. One strategy is printing set-cookie headers, like this:
Set-Cookie: VarName=Value;path=/;domain=.mydomain.com
Of course, this does absolutely nothing in the way of fine details like escaping values, etc. (The CGI module does all of this automatically when used correctly.) Escaping variable names is particularly unstable: I've seen cases where different versions of IE/NS had different ideas about whether to stomp underscores in variable names before sending them.
Another idea to consider is a very minimal use of the CGI module. That is: refactor the acquisition of variable/cookie names and values, and use print $q->header and its variants, and $VarName = $q->cookie(...) to properly construct the cookies...but leave all generation of HTML proper as-is (print to STDOUT is typical). I personally am accustomed to editing HTML in a programming file editor rather than a GUI environment, so I have no immediate pressure to use any of the HTML-generating shortcuts.
|