Unexpected Logging out

Hi, I have the following code for login/logout. The issue is, if I try to login within 1/2 second after logout, it successfully logs in, but then automatically logs out. But if I give it appx. 3 seconds after logout and the re-login, its fine. Is there any configuraion I am missing, or some bug in my code is doing this?
(NB: No Error in Console)

Template.tplLogin.events({
    'submit .js-frm-login': function(e, i) {
        e.preventDefault();
        userEmail = e.target.email.value;
        userPassword = e.target.password.value;
        if (!userEmail || !userPassword) {
            $("#helpLogin").html("User credential fields cannot be left empty");
        } else {
            Meteor.loginWithPassword(userEmail, userPassword, function(error) {
                if (error) {
                    $("#helpLogin").html(error.reason);
                } else {
                    console.log('Authentication Successful.');        
                }
            });
        }
    }
});

<template name="tplLogin">
    <form class='.js-frm-login'>
        <input type='text' id='email' >
        <input type='password' id='password' >
        <span id='helpLogin'></span>
    </form>
</template>
<template name="tplMasterLayout">
    {{#unless currentUser}}
        {{> tplLogin}}
    {{else}}
        <span>LOGGED IN</span>
    {{/if}}
</template>

In Meteor there are three different user states. A user can be logged in, logging in, or logged out. That means that when a user successfully submits their credentials there will be a delay of time where a user is loggingIn. Check out the docs for more information: http://docs.meteor.com/api/accounts.html#Meteor-loggingIn