$(window).on("load", function () { $.ajax({ url: "/api/get_my_sessions", type: "GET", contentType: "application/json", success: function (resp) { let timezone_offset = new Date().getTimezoneOffset(); resp.forEach((session) => { let s_started = beautify_date(session.started); let s_expires = beautify_date(session.expires); $("#sessions-table").append(`${session.user_agent_name}${s_started}${s_expires === null ? "-" : session.expires}Terminate`); }); }, failure: function (err) { alert(err); } }); });