when the user logs in a session with their id is stored, if the ID in the recordset is the same you could bypass the check.
this example assumes that the session created by the login is "ID" and the name of the ID column in your database is "ID"
$WAFV_Errors .= WAValidateNM((($row_rsChkRefNo['ID'] == $_SESSION['ID'])?0:$totalRows_rsChkRefNo) . "",-1,0,0,",.",true,4);