Snoot.org General (archives): How to use cookies... Version 2 (zoom)

[ back | refresh | last 25 | post new ]

How to use cookies... Version 2
[417] by "Bucko" (spare6.btinternet.com)   on Thu 09 Mar 2000 14:02:48     reply ] [ up ]
Right, Tom, here's what I found... these work on Apache, anyway...

Setting a cookie:

Send, with your normal "content-type: text/html" a second bit of header saying "set-cookie: (The cookie text)".

Retrieving a cookie:

Retreive the parameters, as you would with a HTTP Post (or however you do it in your scripting language). Andway, one of the parameters that is sent is "HTTP_COOKIE=(Cookie text)".

You can put what you want in a cookie, provided it's text, and has no special characters in it.

This has been determined experimentally using activeperl and Apache, but I would think that it applies to all server software and scripting languages, just needs implemeting in the right way.

The headers are sent through STDIN, or the defualt input source, BTW.

HTH, HAND.