lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On May 3, 2008, at 10:20 PM, Jilani Khaldi wrote:

I have solved it only partially. I need now only to know how to read and write cookies. Any idea?

In HTTP, look for the 'cookie' header for read and use the 'set- cookie' header for write.

In CGI, the corresponding variables will be prefixed with 'HTTP_', .e.g. 'HTTP_COOKIE' and 'HTTP_SETCOOKIE'.

RFC 2965 defines the cookie format itself:

"HTTP State Management Mechanism"
http://tools.ietf.org/html/rfc2965

Here is an implementation in Lua:

http://dev.alt.textdrive.com/browser/HTTP/HTTPExtra.lua#L334