diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-04-16 19:12:12 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-04-16 19:12:12 -0400 |
commit | 369f5592adc342fc7e2436fa14ec6671c747685e (patch) | |
tree | 7e56853b9d7b3d70846add897bdffc1d309cae94 /tests/cookieSec.ur | |
parent | 7f7d05616c489b6039bc1e8824c00b43209109c2 (diff) |
Cookie signing working for forms
Diffstat (limited to 'tests/cookieSec.ur')
-rw-r--r-- | tests/cookieSec.ur | 24 |
1 files changed, 24 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> |