test_cookies.lua 344 B

1234567891011121314
  1. local cookies = require"cgilua.cookies"
  2. CL_COOKIE = "cgilua_cookie"
  3. local test = cookies.get (CL_COOKIE)
  4. cookies.set (CL_COOKIE, os.date())
  5. cgilua.htmlheader ()
  6. cgilua.put ([[
  7. <h1>Testing Cookies library</h1>
  8. ]]..CL_COOKIE..' = '..tostring(test)..[[<br>
  9. Assigning current date to cookie!<br>
  10. Reload this script to check cookie's value!
  11. ]])