You are not logged in.
PS: please, please, please, in the JavaScript, when you have variables, don't call them x and y (except if they're coordinates), call them user and password instead, to avoid confusion.
Yeah this is like my first script so it was like a test to see everything works but When doing the real deal everything should be clear like I do in java.