diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cookieSec.ur | 24 | ||||
-rw-r--r-- | tests/cookieSec.urp | 5 | ||||
-rw-r--r-- | tests/cookieSec.urs | 1 |
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/cookieSec.ur b/tests/cookieSec.ur new file mode 100644 index 00000000..ea5c9116 --- /dev/null +++ b/tests/cookieSec.ur @@ -0,0 +1,24 @@ +table t : {Id : int} + +cookie c : int + +fun setter r = + setCookie c (readError r.Id); + return <xml>Done</xml> + +fun writer () = + ido <- getCookie c; + case ido of + None => error <xml>No cookie</xml> + | Some id => dml (INSERT INTO t (Id) VALUES ({[id]})); + return <xml>Done</xml> + +fun main () = return <xml><body> + <form> + <textbox{#Id}/> <submit value="Get cookie" action={setter}/> + </form> + + <form> + <submit value="Write to database" action={writer}/> + </form> +</body></xml> diff --git a/tests/cookieSec.urp b/tests/cookieSec.urp new file mode 100644 index 00000000..a2567db4 --- /dev/null +++ b/tests/cookieSec.urp @@ -0,0 +1,5 @@ +debug +database dbname=cookiesec +sql cookieSec.sql + +cookieSec diff --git a/tests/cookieSec.urs b/tests/cookieSec.urs new file mode 100644 index 00000000..6ac44e0b --- /dev/null +++ b/tests/cookieSec.urs @@ -0,0 +1 @@ +val main : unit -> transaction page |