I am using $window.sessionStorage.isLoggedIn
variable for handling logged in
in angularjs
as follows,
$routeProvider
.when('/', {
templateUrl: 'app/components/main/dashboard.html',
controller: 'dashboardController',
resolve: {
loggedIn: function ($location, $window) {
console.info($window.sessionStorage.isLoggedIn)
if (!$window.sessionStorage.isLoggedIn) {
$location.path('/login');
}
}
};
})
Normally it is working fine,but when I am opening my web app in new tab in same browser,the value of $window.sessionStorage.isLoggedIn
will be undefined and redirecting to login
page, meanwhile in my previous tab,my app is working as logged in . Why it is happening? Local storage is tab independent?