anchor.diff:  let register =
       choose [
           GET >>= (View.register "" |> html)
  +        POST >>= bindToForm Form.register (fun form ->
  +            let ctx = Db.getContext()
  +            match Db.getUser form.Username ctx with
  +            | Some existing -> 
  +                View.register "Sorry this username is already taken. Try another one." |> html
  +            | None ->
  +                let (Password password) = form.Password
  +                let email = form.Email.Address
  +                let user = Db.newUser (form.Username, passHash password, email) ctx
  +                authenticateUser user
  +        )
       ]
   
   let cart = 
  
positive.code:             let (Password password) = form.Password
              match Db.validateUser(form.Username, passHash password) ctx with
              | Some user ->
                      Auth.authenticated Cookie.CookieLife.Session false 
                      >>= session (function
                          | CartIdOnly cartId ->
                              let ctx = Db.getContext()
                              Db.upgradeCarts (cartId, user.UserName) ctx
                              sessionStore (fun store -> store.set "cartid" "")
                          | _ -> succeed)
                      >>= sessionStore (fun store ->
                          store.set "username" user.UserName
                          >>= store.set "role" user.Role)
                      >>= returnPathOrHome
              | _ ->
                  View.logon "Username or password is invalid." |> html
          )
  
negative.code: let bindToForm form handler =
      bindReq (bindForm form) handler BAD_REQUEST
  
  let authenticateUser (user : Db.User) =
      Auth.authenticated Cookie.CookieLife.Session false 
      >>= session (function
          | CartIdOnly cartId ->
              let ctx = Db.getContext()
              Db.upgradeCarts (cartId, user.UserName) ctx
              sessionStore (fun store -> store.set "cartid" "")
          | _ -> succeed)
      >>= sessionStore (fun store ->
          store.set "username" user.UserName
          >>= store.set "role" user.Role)
      >>= returnPathOrHome
  
  let logon =
      choose [
          GET >>= (View.logon "" |> html)
  