Hi skp,
Try to set $sessionStorage operation on some interval.
<script type="text/javascript">
var LoginApp = angular.module('LoginApp', ['ngStorage']);
LoginApp.controller('LoginController', function ($scope, $http, $window, $sessionStorage) {
$scope.submit = function () {
var UserData = { username: $scope.Username, password: $scope.Password }
$http.post('Login.aspx/ValidateUser', UserData)
.then(function (response) {
if (response.data.d == 22) {
setTimeout(function () {
$sessionStorage.User = UserData;
$window.location.href = 'Details.aspx';
}, 50);
}
else {
setTimeout(function () {
//delete $sessionStorage;
$sessionStorage.$reset();
$window.alert("You are not authorized.");
}, 50);
}
});
}
});
</script>
skp says:
$sessionStorage.SessionMessage = response.data;
Assign this inside the if condition.