File: test_cookies.lua

package info (click to toggle)
lua-cgi 5.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 524 kB
  • ctags: 333
  • sloc: sh: 93; makefile: 22
file content (14 lines) | stat: -rw-r--r-- 344 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
local cookies = require"cgilua.cookies"
CL_COOKIE = "cgilua_cookie"

local test = cookies.get (CL_COOKIE)
cookies.set (CL_COOKIE, os.date())

cgilua.htmlheader ()
cgilua.put ([[
<h1>Testing Cookies library</h1>

]]..CL_COOKIE..'  = '..tostring(test)..[[<br>
Assigning current date to cookie!<br>
Reload this script to check cookie's value!
]])