Check if a session exists in the session folder:
echo ini_get('session.save_path');
for example, in the folder session id file:
sess_l75lm4ktlhvlu566n8i6do8k71
():
ini_set ('session.cookie_lifetime', 100)
session_destroy(); :
if (file_exists($sessionfile)) {
echo "exists";
}else{
echo "not exist"
}
js ( firefox):
<script type="text/javascript">
window.onbeforeunload = function () {
return "Do you really want to close?";
};
window.onunload = function () {
return "Do you really want to close?";
};
$(window).on('beforeunload', function(){ alert ('Send post to unlock product')});
$(window).unload( function () { alert("'Send post to unlock product'"); } );
</script>
user7601056