Just do everything prior to printing out the header. It'd go something like this:
Check for the cookie. If present and valid, print the header and respond as appropriate. If no cookie, then check for form data being submitted. Verify the data and return the cookie with the header if appropriate. If no form data that is valid, print the header without a cookie and show the form.
Just be aware that browsers can be set to not allow for cookies. Also, don't store anything important in them (i.e. username and password when using it can allow them to get cc numbers...etc.). I think merlyn has an article on it at his site.
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
In reply to Re: yummm...cookies, anyone?
by antirice
in thread yummm...cookies, anyone?
by sulfericacid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |