[英]clear the current session after closing the tab or browser in the Firebase real-time database in Javascript
[英]Clear user session on closing browser in Wordpress
我想在關閉瀏覽器或標簽的同時清除wordpress中前端用戶的當前會話。 當前,當我登錄並關閉瀏覽器時,該用戶已經登錄。
我正在使用Wordpress 4.0版本。 因此,請告知我如何實現這一目標。
如果您可以包含JavaScript並知道確切的wordpress cookie,則可以使用以下代碼檢測close事件並在內部清除cookie
window.onbeforeunload = function () {
// Clear cookie here
};
為什么不使用wp_logout函數? 銷毀活動會話。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.