How to properly handle page refresh?
Create a SESSION ID when the user enters the Registration page and store it in the database. I think session id will change only when user close the browser.
If user refresh the page retrive the values from the database with the SESSION ID.
When user click submit button and successfully query the values to database. Destroy the SESSION ID reset the form fields...
I have a form on my page with many fields. I save field values in the datastore once user input a value (without waiting for form submission). Some score is calculated based on field values and displayed to the user. I also generate user's client id and store that in user's cookies for one hour.
I am not sure what should happen when user refreshed the page in browser:

if user pressed F5 in FF, then field values are still displayed in the browser;
when user pressed Ctrl+F5, then values are cleared.

In both cases I don't want to create new record for this user, so client id should remain the same. But in scenario (1) I should NOT clear field values in datastore and its score, but I should do it in scenario (2). How can I recognize that on the server side?