Hello Lightstreamer community,

i am trying to realize a user authentication with a simple login form.
on click to submit button i call the createEngine function in whose event i set the username and password to the connection object.

Code:
engine.connection.setUserName(document.getElementById("user").value);
engine.connection.setPassword(document.getElementById("password").value);
these two information become sent to the notifyuser function of the metadataadapter, where i check if the login is correct.
if not i throw AccessException.
here comes the first problem: the user should now try to log in again, but when he types in a new user / pass and clickes again on submit, there comes an Exception 'ER createEngine() has already been called createEngine '. I tried to avoid it by calling
Code:
engineRef.changeStatus("DISCONNECTED");
but engineRef is null at this point of time.

second problem is that when i check up the login and it is correct, how can i redirect to the next page?

Thanks mluecke