Reputation: 712
I have several different form applications where each form page is a separate application. The user answers questions on one page, then navigates to another to continue filling out the form.
I need to post custom data from a form in various applications to one server. (For example using ajax). How can I figure out that this is one user to write data into one database record? Do I need to use cookies or something else?
EDIT: I distribute my js package to clients, and I need to implement this without affecting anything other than this js package.
EDIT: I got the idea to generate and retrieve cookies from my centralized application using an iframe, like Facebook does with a Like button.
Can I, on the first visit to the form on one of the applications, create an iframe using js and generate a UUID for the user, write it to a cookie, and on another page of the form, request these cookies with a uuid
Upvotes: 0
Views: 94
Reputation: 14275
When a user visits your page, generate a unique identifier (e.g., a UUID, here's an example of how to generate one) using JavaScript and store it either as a cookie or in local storage. Send that along whenever you send a request to the server.
Upvotes: 1