The headers of an SSI (including Set-Cookie) never make it anywhere near the browser; they're strictly interpreted by the server. You'll have to have the browser fetch something (such as an image, or the next page) to include headers to set a cookie.
-- Randal L. Schwartz, Perl hacker | [reply] |
johnm, I don't want to sound too harsh, but you registered
half an hour ago, just to post a question. That's fine,
you are not the first one to do so and we are happy to welcome you on board,
but if you had looked at the site a little bit you would
have found a couple of things:
- questions that get answers are usually much more
precisely worded than yours, including a bit of
code, whether you use CGI.pm, Apache & mod_perl,
etc... all make it much more easy for people to
answer.
- there is a nifty Search field right at the top of
the page, SSI Cookies retrieves a long, long
list of posts on the subject. Did you check them?
So I don't want you to think that we are a bunch of grumpy
old misanthropes (most monks are much nicer than I am,
just don't rub merlyn or tye the wrong way), but if
you want this site to be useful for you I think you should
spend a little time learning about it. It will make it
much more enjoyable both for you and for the rest of the
community.
Don't take it too personnaly though, I guess you are paying
for the numerous newcomers that behaved the same way, but
that's the long explanation for the short -- on your post.
And read those posts on SSI and Cookies...
| [reply] |
There is a <furtive whisper>javascript</furtive whisper> solution here. Just add
onload='document.cookie="name=whatever;expires=whenever";'
to your <body> tag. Actually it doesn't even need to be in the <body>, it can be run at any point in your html.
But if you sleep with the Devil, don't come crying to me when your child is born with two heads and a tail. :)
| [reply] |