Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: SSI and *reading* a cookie only

by jfrm (Monk)
on Jun 20, 2005 at 12:11 UTC ( [id://468299]=note: print w/replies, xml ) Need Help??


in reply to Re: SSI and *reading* a cookie only
in thread SSI and *reading* a cookie only

Dear Merlyn,

Thanks for replying. I now have a solution to this question (well more correctly, I've understood why my question was a dud) which I will post in a sec.

Regarding, the setting of a cookie, I puzzled over your paragraph for a few minutes, trying to understand what you were saying. In the end I decided that we were both saying the same thing but neither of us said it very well, me in particular. I don't understand why you bring MIME into this but that is probably my ignorance. But I wanted to fix what I said so that I don't mislead monks searching on this subject in the future.

I think that you cannot set a cookie with an SSI script because the set-cookie command goes into the CGI header before the html starts. Since that's the only place the server looks for the set-cookie command, it is not going to find it in the output of the SSI which is embedded into the HTML.

Replies are listed 'Best First'.
Re^3: SSI and *reading* a cookie only
by merlyn (Sage) on Jun 20, 2005 at 13:06 UTC
    No, you can't set a cookie in an SSI because the SSI headers are ignored (including your set-cookie header). I think I said this. You can put "scooby-doo: where are you?" in an SSI header, and you won't see it in your output. SSI headers are ignored. And my point about MIME type is that that's a typical header (in fact, mandatory).

    It has nothing at all to do with the timing of invoking the SSI. In fact, the SSI could be (and typically is) complete before the first byte has been sent to the browser. It's just that by decree, SSI headers don't matter (except a redirect, and maybe some other status values).

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://468299]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-16 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found