# frozen_string_literal: true require 'securerandom' module BigSession # SessionId object bridges an access from users to session id class SessionId class << self def current Thread.current[::BigSession::THREAD_BIG_SESSION_ID_KEY] end def set(value = nil) Thread.current[::BigSession::THREAD_BIG_SESSION_ID_KEY] = value || new_session_id end def new_session_id SecureRandom.hex(16) end end private_class_method :new_session_id end end