"Faine, Mark" wrote:
>
> I cannot stop my cookies from actually printing on the page, I've tried to
> find an example of how to properly use cookies with CGI::Application but the
> best I can find are vague references to some header methods that appear to
> be of no use.
>
> ....
> CGI::Application, by default, will return all content as MIME type
> "text/html". This is set by the HTTP headers. If you wish to set a different
> MIME type, manipulate a cookie or perform a HTTP redirect, then you will
> need to change the default HTTP headers. This is done by using two inherited
> CGI::Application methods: header_type() and header_props(). Refer to
> CGI::Application's perldoc for details on their usage.
>
> Could someone please give me a hand and just show me how to do this with a
> brief example. I have two cookies that must be set, one can be set in run
> mode 1 and the other must be set in run mode 2
Mark,
I think the examples you want are in the documenatation for CGI.pm,
particular the sections on Cookies and headers. You probably want to end
with something like this:
$self->header_props(
-cookie=>$cookie
);
####
or you could set a cookie and redirect by doing this first:
$self->header_type('redirect');
It sounds like you are probably currently manually returning a set of
headers, and CGI::Application is automatically adding another set for
you.
-mark
. . . . . . . . . . . . . . . . . . . . . . . . . .
Mark Stosberg Principal Developer
[EMAIL PROTECTED] Summersault, LLC
765-939-9301 ext 223 website development
. . . . . http://www.summersault.com/ . . . . . . .
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]