diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-11-06 14:03:50 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-11-06 14:03:50 -0500 |
commit | d6dbcd83918e1cc3b6f6bba2f2b8e82bb15a6e7b (patch) | |
tree | 9e9881243ec7e26be8817357bfc5aa2ede51802a /tests | |
parent | 24777c2dc9b6ea0f3db24ae372be2af0c3f70602 (diff) |
Cookies work across pages
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cookie.ur | 18 |
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> |