From f67268ab0301c92bb48f5a85b648739de570c792 Mon Sep 17 00:00:00 2001 From: Pingfan Hu Date: Tue, 26 Nov 2024 16:49:53 -0500 Subject: [PATCH] Update server.R --- R/server.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/R/server.R b/R/server.R index d9dd11ec..969ea63e 100644 --- a/R/server.R +++ b/R/server.R @@ -1398,8 +1398,14 @@ handle_sessions <- function(db, session, input, time_start, start_page, current_ session_registry$current_id <- session$token } - # Check use_cookies flag - if (!use_cookies) { + # Check if we should proceed with cookie logic + should_use_cookies <- use_cookies && ( + !is.null(db) || # Has database connection + file.exists("preview_data.csv") # Has preview data file + ) + + # Return early if we shouldn't use cookies + if (!should_use_cookies) { return(session$token) }