Monthly Archives - December 2013

Log a user out on closing of a tab or browser

When closing a browser/tab close a session. [javascript] $(document).ready(function () { $(‘form’).submit(function () { $(window).unbind(‘beforeunload’); }); $(‘a’).on(‘mousedown’, stopLinkNav); $(‘a’).on(‘mouseleave’, function () { $(window).on(‘beforeunload’, function () { return ‘Are you sure you want to leave?’; }); }); function stopLinkNav() { $(window).off(‘beforeunload’); } $(window).on(‘unload’, function () { $.ajax({ async: false, url: "logout_ajax.php" }); }); }); [/javascript] PHP…

Possible car or change stealing attempt?

Terrible last night. Phone died on the sky train so I had to do half of my hour commute listening to the hum of a train. Yeah, I know first world problems… So get off the train and walk to my car in the parkade only to discover that my window was broken. Paused, took…