Clear the application session, when the exe is closed

Is there any way to clear the laravel session if the user closes the exe using its close buttons, instead of laravel applications logout function

Try to use JavaScript code to trigger a PHP script which clears the Laravel session when the window (in this case, the ExeOutput application) is closed.