我想删除tab close上的angular.js中的cookie。
$(window).on('beforeunload', function() {
delete $cookies["Email"];
delete $cookies["isLoggedIn"];
delete $cookies["Token"];
delete $cookies["Name"];
delete $cookies["LogCode"];
});
我在app.js中调用了这个函数,但它不起作用。你能否就这个问题向我提出建议? 请注意:我正在使用angular.js版本1.3
答案 0 :(得分:0)
希望这有帮助
//处理页面刷新和标签关闭
$window.onbeforeunload = function(){
$cookies.remove('Email');
$cookies.remove('isLoggedIn');
//Delete rest of the cookies similarly
};