[Ur] EUnurlify in code to be compiled to JavaScript[2]?
Adam Chlipala
adamc at csail.mit.edu
Sun Apr 30 13:19:21 EDT 2017
Ah, that one's easy for me to spot. Ur/Web doesn't support any
interaction with cookies in client-side code.
On 04/21/2017 07:38 PM, Marko Schütz Schmuck wrote:
> cookie auth : string
> 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>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20170430/ed9f843e/attachment.html>
More information about the Ur
mailing list