Meteor kills user session randomly

0
down vote
favorite
I am using meteor 1.4 for server side and an ionic for client application. We are connecting through meteor client library. we are using following js libraries:

meteor-client-side,
accounts-base-client-side,
accounts-password-client-side
What I have observed that meteor kills user session randomly. Below is sample code and steps to reproduce an issue:

Step 1 : deploy meteor sample site with below code to login/logut

Step 2 : browser the meteor app browser Tab 1 and then login

Step 3 : Now browser the meteor app in another Tab 2 - which shows you logged in

Step 4 : Logout from Tab 2

Step 5 : Again from Tab 2 try to login with different user. In this case Login success but after some seconds it auto logout

for login using following code

$meteor.loginWithPassword($scope.credentials.username,
$scope.credentials.password)
.then(function() {
console.log('Login success ');
//alert("logged in: " + $scope.credentials.username);
$state.go(‘home’);
}, function(_error) {
console.log('Login error - ', _error);
alert("Error: " + _error.reason);
});
for logout using following code

$meteor.logout().then(function(_response) {
$state.go(‘login’);
});
On server logs it shows an error:

Please let me know what is causing to kill the session and if you have any solution for same.

0
down vote
favorite
I am using meteor 1.4 for server side and an ionic for client application. We are connecting through meteor client library. we are using following js libraries:

meteor-client-side,
accounts-base-client-side,
accounts-password-client-side
What I have observed that meteor kills user session randomly. Below is sample code and steps to reproduce an issue:

Step 1 : deploy meteor sample site with below code to login/logut

Step 2 : browser the meteor app browser Tab 1 and then login

Step 3 : Now browser the meteor app in another Tab 2 - which shows you logged in

Step 4 : Logout from Tab 2

Step 5 : Again from Tab 2 try to login with different user. In this case Login success but after some seconds it auto logout

for login using following code

$meteor.loginWithPassword($scope.credentials.username,
$scope.credentials.password)
.then(function() {
console.log('Login success ');
//alert("logged in: " + $scope.credentials.username);
$state.go(‘home’);
}, function(_error) {
console.log('Login error - ', _error);
alert("Error: " + _error.reason);
});
for logout using following code

$meteor.logout().then(function(_response) {
$state.go(‘login’);
});
On server logs it shows an error:

Please let me know what is causing to kill the session and if you have any solution for same.Preformatted text

yeah, I suspect the browser can’t delete your localstorage session id… because it is open in another tab?

try to delete this value manually and see if that solves your issue