<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Ah, that one's easy for me to spot.  Ur/Web doesn't support any
      interaction with cookies in client-side code.<br>
    </p>
    <p>On 04/21/2017 07:38 PM, Marko Schütz Schmuck wrote:
      <blockquote type="cite">cookie auth : string
        <div class="moz-text-plain" wrap="true" graphical-quote="true"
          style="font-family: -moz-fixed; font-size: 12px;"
          lang="x-western">
          <pre wrap="">
fun startSession (email : string) : transaction unit
  = setCookie auth {Value = email,
                    Expires = None,
                    Secure = False}

fun main () : transaction page
  = loggedIn <- source (None : option string);
    scUser <- source "";
    return <xml><body>
      <ctextbox source={scUser}/>
      <button value="Login" onclick={fn _ =>
                                        vu <- get scUser;
                                        rpc (startSession vu);
                                        c <- getCookie auth;
                                        case c of
                                            None => set loggedIn None
                                          | Some _ => set loggedIn (Some vu)}/>
      </body></xml>

</pre>
        </div>
      </blockquote>
      <br>
    </p>
  </body>
</html>