using cookies is not the correct approach for this.
when using server validation on a page, there will be a binding group in the bindings panel called Validated Entries.
The validated entries bindings will save the form values that pass validation when validation fails.
use the validated entries bindings as the initial value for the form elements to retain the values when validation fails.