Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disconnect sessions first before logout on idletimeout #5838

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 17 additions & 1 deletion views/default.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -2330,7 +2330,23 @@
function setSessionActivity() { sessionActivity = Date.now(); QH('idleTimeoutNotify', ''); }
function checkIdleSessionTimeout() {
var delta = (Date.now() - sessionActivity);
if (delta > serverinfo.timeout) { window.location.href = 'logout'; } else {
if (delta > serverinfo.timeout) {
if (desktop != null) { // Disconnect remote desktop
desktop.Stop();
webRtcDesktopReset();
desktopNode = desktop = null;
if (pluginHandler != null) { pluginHandler.callHook('onDesktopDisconnect'); }
}
if (terminal != null) { // Disconnect terminal
terminal.Stop();
terminal = null;
}
if (files != null) { // Disconnect files
files.Stop();
files = null;
}
window.location.href = 'logout';
} else {
var ds = Math.round((serverinfo.timeout - delta) / 1000);
if (ds <= 60) {
QH('idleTimeoutNotify', '<br />' + format((ds == 1)?"1 second until disconnect":"{0} seconds until disconnect", ds));
Expand Down