all for processing must occur on the forms action page.
the action of your form is to post to another page:
<form id="hdwlogin" name="hdwlogin" method="post" action="redirect_to_mem_home.php" onsubmit="return HDW_verify_Login(this)">
the behaviors to set the cookie values would need to be applied to the forms action page:
redirect_to_mem_home.php