javascript - SignalR OnConnected & OnDisconnected with Signin & Signout -


my scenario construct website custom authentication, there's menu transition mouse click, , because of custom tool, use window.location change page;

but login , out been used calculate daily report of each login/out user, have prevent user close browser tab or close button;

and search, there's no proper method distinguish reload , close, tried use signalr deal these situation.

is there idea detect user's onconnected & ondisconnected triggered reload or close tab/browser?

please try one, think should helpful you.

javascript

window.onbeforeunload = function(e){     var msg = 'are sure?';     e = e || window.event;      if(e)         e.returnvalue = msg;      // ondisconnected event here (signalr) } 

jquery

$(window).unload(function() {    // ondisconnected event here (signalr) }); 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -