I am using the REST API to send info from a form I have built myself. I have no issues adding the user, but I have noticed there seems to be no way to update the cookie after the form is submitted when the user goes from being an anonymous lead to being a known lead.
I am using http://developers.marketo.com/documentation/rest/get-multiple-leads-by-filter-type to pull data by sending the cookie to prefill form fields if the user is a known lead. This works just fine if they come from a marketo hosted landing page (and their cookie is synced with their email and id), the lead is synced with their cookie and the form gets filled.
An issue occurs when they have never filled out a non REST based form. An anonymous lead has a cookie (_mkto_trk) and shows up to the REST API form. They fill it out and click submit. They now become a proper lead and have a marketo ID. However the cookie never changes and never gets tied to their email. Therefore, if they ever hit the form again (or any form marketo hosted landing page or not) they are not actually tied to the proper account, they are still cookied as anonymous.
So how using only the REST API or Munchkin Code can I tie the cookie and the marketo id/ email together? I am not interested in any solution that uses the SOAP api.