Since the forms action is to post to the cookiesresults.php page, the code for setting cookies must be on that page.
Either set the forms action to blank, and use the WebAssist Utilities -> Server Redirect server behavior to redirect to the results page after the cookies are set, or move the cookie code to the results page.