move the code to set the session:
<?php
if (!session_id()) session_start();
if("" == "") {
$_SESSION["CouponCode"] = "".WA_RandomPassword(6, false, true, true, "") ."";
}
?>
to be after the code for the recordset, than use the same if state around it to check if email verified in the recordset is equal to 0