Are you including the file functions/functions_login.asp in this page?
Also the function although does create user session and cookies simply returns a number, the key for which is below:-
'Key to login response
'0 = Login Failed
'1 = Login OK
'2 = CAPTCHA Code OK
'3 = CAPTCHA Code Incorrect
'4 = CAPTHCA required
So for example if the function returns 0 then it means the login has failed due to incorrect username or password, 1 means login is successful and the others mean issues with the CAPTCHA code entered.