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>


_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to