adamc@1052: cookie user : {EMail : string}
adamc@1052:
adamc@1052: fun main () =
adamc@1052: ro <- getCookie user;
adamc@1052: case ro of
adamc@1052: Some u => welcome u
adamc@1052: | _ => login ()
adamc@1052:
adamc@1052: and welcome u = return
adamc@1052: Welcome {[u.EMail]}. Logout
adamc@1052:
adamc@1052:
adamc@1052: and logout () =
adamc@1052: clearCookie user;
adamc@1052: main ()
adamc@1052:
adamc@1052: and login () = return
adamc@1052:
adamc@1052:
adamc@1052:
adamc@1052: and signin r =
adamc@1052: setCookie user {Value = {EMail = r.EMail},
adamc@1052: Expires = None, (* Some (readError "2012-11-6
adamc@1052: 00:00:00"), *)
adamc@1052: Secure = False
adamc@1052: };
adamc@1052: main ()