$(document).ready(function() {
    // Your code here
    console.log("home.js is loaded and ready.");
    $('#logoutbtn').on('click', function() {
        // Clear session storage on logout
        fetch('/logout').then(() => {
            window.location.href = '/login.html';
        });
    });
});

$(window).on('unload', function() {
    console.log("User is leaving home.html");
    // Your cleanup code here
});