summaryrefslogtreecommitdiff
path: root/tests/cookie.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 14:03:50 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 14:03:50 -0500
commit27e3c3ba965513dcb3e447cccf6e77ce8c63e90d (patch)
tree9e9881243ec7e26be8817357bfc5aa2ede51802a /tests/cookie.ur
parent5e95ccda9544c96b519d2cf6b32967f4b1ef990a (diff)
Cookies work across pages
Diffstat (limited to 'tests/cookie.ur')
-rw-r--r--tests/cookie.ur18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/cookie.ur b/tests/cookie.ur
index cb4f8854..bef45a4f 100644
--- a/tests/cookie.ur
+++ b/tests/cookie.ur
@@ -1,8 +1,22 @@
cookie c : string
-fun main () : transaction page =
- setCookie c "Hi";
+fun other () =
so <- getCookie c;
case so of
None => return <xml>No cookie</xml>
| Some s => return <xml>Cookie: {[s]}</xml>
+
+structure M = struct
+ fun aux () =
+ setCookie c "Hi";
+ so <- getCookie c;
+ case so of
+ None => return <xml>No cookie</xml>
+ | Some s => return <xml><body>Cookie: {[s]}<br/>
+ <a link={other ()}>Other</a></body></xml>
+end
+
+fun main () : transaction page = return <xml><body>
+ <a link={other ()}>Other</a><br/>
+ <a link={M.aux ()}>Aux</a><br/>
+</body></xml>