Cookie 4 newbie
[1/4] from: pablo_74:libero:it at: 13-Jul-2001 18:13
Hello Rebol-People,
i have to ask u a little question:
how i can write and read a cookie?
i have intention to ask to the to the my homepage visitor to select some optiosn
from a combobox.
This selection insert in the cache a cookie with the value selected, and every
time the the visitor entering in the site, jump the combobox and entering in the
choosed page.
How i can?
Tnx 4 all people,
Giannuzzi Paolo
[2/4] from: syke::amigaextreme::com at: 13-Jul-2001 19:54
Hi,
to set a cookie for a user, print it in the HTTP header, like this for
example:
print rejoin [{Content-Type: text/html^/Set-Cookie: foo=bar; expires=Fr,
01-Jan-2010 00:00:00 GMT; path=/^/}]
The Path and Expires values are optional...
to read the cookie, do something like this:
cgi-headers: make block! system/options/cgi/other-headers
do decode-cgi pick cgi-headers index? next find cgi-headers "HTTP_COOKIE"
It's all in the head(ers) ;-)
/Regards Stefan Falk - www.amigaextreme.com
[3/4] from: pablo_74:libero:it at: 16-Jul-2001 16:55
salve Stefan
On 13-Lug-01, you wrote:
> Hi,
> to set a cookie for a user, print it in the HTTP header, like this for
> example:
>
> print rejoin [{Content-Type: text/html^/Set-Cookie: foo=bar; expires=Fr,
> 01-Jan-2010 00:00:00 GMT; path=/^/}]
>
> The Path and Expires values are optional...
yeah!
but, where?
in an html code?
that print will be inglobated in the <html></html> tags?
Txn however,
Paolo
--
http://www.victorianpub.com - Disco-Cabaret-Pub
[4/4] from: syke:amigaextreme at: 16-Jul-2001 20:19
Hi,
it should be printed before anything else... ie:
print rejoin [{Content-Type: text/html^/}]
print rejoin [{<html><head></head><body></body></html>}]
/Regards Stefan Falk - www.amigaextreme.com