Thomas:
> has anyone looked into adapting the default http scheme to support
>  cookies (ie. be able to set them and/or remember them across reads)?

There are several scripts in the Library that do things with cookies -- do a 
search on www.rebol.org for details.

Cookies are fairly easy to handle anyway -- could you say what you see the 
advantages would be to extending the scheme?

Basic cookie handling:

To set a session cookie -- just print it as part of the HTTP headers:

my-cookie: "name=data"
print join "set-cookie: " my-cookie

To set a longer cookie -- just add an expiry date:

my-cookie: "name=data ; expires=" to-idate now + 31   ;; 31 days
print join "set-cookie: " my-cookie


To access a cookie:

my-cookie: select system/options/cgi/other-headers "HTTP_COOKIE"


Things are slightly more complicated if you have multiple cookies. Some code 
assistance may be useful there.

Sunanda.
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to