In my app I have local sign-in and Google+ sign-in. Suppose if I login with the Google+ and after I click on the signout it works perfectly. But afterwards, if I need to login with a new User it is directly logging in with previous login without asking for login. For this reason I want to delete my cookies.
The corresponding code is given below...
this is my HTML file:
<a ng-click="signout()">Signout</a>
Controller.js:
$scope.signout = function () {
$http.get('/auth/signout').success(function(response){
console.log("nothing" + JSON.stringify(response));
var wind = window.user;
$cookies.wind = '';
console.log("windows" + JSON.stringify(wind));
$cookieStore.remove('wind');
//delete $cookies["wind"];
$location.path('/');
});
};
Where window.user is where the cookie data will be storing.
server.js:
exports.signout = function (req, res) {
req.logout();
res.status(200).send("logged out");
// res.redirect('/');
console.log('server side signout function called');
};
I tried $cookieStore.remove('wind'); and delete $cookies["wind"]; But both are not working, Please tell me of other methods to solve this (and any solutions to this problem)