lua-users home
lua-l archive

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

> So, what does options.expires stand for?
> and what should
>   if options.expires then
>     local t = date("!%A, %d-%b-%Y %H:%M:%S GMT", options.expires)
>     cookie = cookie .. %Private.optional("expires", t)
>   end
    This function can receive an optional table parameter with
some cookie modifiers (expires, path, domain, secure).  CGILua has
a modified "date" implementation that can receive a second argument;
this second argument is a number that represents the number of seconds
since 1/1/1970 (Ana Lucia, please correct me if I'm wrong) until the
desired date.  If there is no second argument, the current date is used;
the date function will then format the given (or the default) date.

> do (evaluated on the console date() always returns the current date, 
> regardless the second parameter - correct me if I'm wrong).
    I think this implementation anticipates the behaviour of
"date" in Lua 5.0 .