logout a meteor user on window/tab close but not on page refresh.
问题 I have used window.onbeforeunload to logout a meteor user on browser tab close. It works fine with tab close but my user gets log out on page refresh which I do not want. Is there any solution to this problem. I want user to not logout on page refresh. I am new in Meteor. Any help would be highly appreciated. The code I have used for this is window.onbeforeunload = function() { Meteor.logout(); } 回答1: I'm kinda new to meteor too and after many tries I found this solution : if (sessionStorage