This function retrieves the session ID from the session's cookies. If the session ID does not exist, it generates a new session ID using the session token and sets it. It also ensures the session directory is created in the specified temporary directory.

get_session_id(session, temp_dir)

Arguments

session

The Shiny session object containing request and token information.

temp_dir

A character string specifying the path to the temporary directory for session data.

Value

A character string representing the session ID.