aboutsummaryrefslogtreecommitdiff
path: root/circuitpython/lib/axtls/www/lua/test_cookies.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--circuitpython/lib/axtls/www/lua/test_cookies.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/circuitpython/lib/axtls/www/lua/test_cookies.lua b/circuitpython/lib/axtls/www/lua/test_cookies.lua
new file mode 100644
index 0000000..6af935e
--- /dev/null
+++ b/circuitpython/lib/axtls/www/lua/test_cookies.lua
@@ -0,0 +1,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!
+]])