[英]how to delete angular.js v 1.3 cookies on 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版
希望這可以幫助
//處理頁面刷新並關閉標簽
$window.onbeforeunload = function(){
$cookies.remove('Email');
$cookies.remove('isLoggedIn');
//Delete rest of the cookies similarly
};
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.