Device Management System Relay Cookie Domain Handling
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing device management systems face challenges in establishing and managing sessions between clients and devices, particularly when using relay systems, which can lead to issues with cookie generation and domain access, affecting the reliability and efficiency of API requests.
Innovation Solution
The proposed system includes a backend that generates Cookies for session establishment, with a frontend that uses either a relay domain or a normal domain based on the client's access method, ensuring proper cookie transmission and session management through relay or direct access, utilizing a relay system for API requests.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If a relay system is used for API requests, then clients can access the device management system through a relay domain, but cookies may be discarded due to domain mismatch issues
Solution Approach 1:
The relay system acts as an intermediary between the client and the backend, forwarding requests and responses while managing cookie transmission. The relay system receives cookies from the backend and transmits them to the client, ensuring that session information is properly maintained even when accessing through a relay domain rather than directly to the backend domain
Solution Approach 2:
The system separates the relay domain and backend domain as distinct entities, with the relay system handling client communications and the backend handling actual processing. This segmentation allows each component to operate with its own domain-specific cookies while maintaining overall session consistency through the relay system's coordination
2Reliability
If the backend generates cookies with relay domain for relay access, then session establishment works through relay system, but direct access without relay system may fail
Solution Approach 1:
The system dynamically adjusts cookie domain attributes based on the access method being used. When a client accesses through the relay system, the backend generates cookies with the relay domain as the domain attribute. When a client accesses directly without the relay system, the backend generates cookies with the backend domain as the domain attribute. This dynamic adaptation ensures optimal session establishment for each access scenario
Solution Approach 2:
The domain attribute of the cookie is changed based on the access method. For relay access, the cookie's domain parameter is set to the relay domain; for direct access, the cookie's domain parameter is set to the backend domain. This parameter change allows the same cookie mechanism to work correctly across different access methods
3Device complexity
If the frontend always uses relay domain for backend access, then relay system integration is simplified, but direct client access to backend becomes problematic
Solution Approach 1:
The frontend dynamically determines which domain to use for backend access based on the current access context. When the frontend is accessed through the relay system, it uses the relay domain to communicate with the backend. When the frontend is accessed directly by the client, it uses the backend domain directly. This dynamic domain selection simplifies relay integration while maintaining direct access capability
Data Source
AI summary
A device management system includes a frontend and a backend. The frontend includes a first domain. The backend includes a domain of a relay system as a relay backend domain that is a domain of the backend. The frontend accesses the relay backend domain when an access that uses a URL including the first domain as a domain name is received from a client via the relay system, and a request for an API is thus received from the client. The backend generates a relay Cookie including the relay backend domain as a domain used for establishing the session. The frontend transmits the relay Cookie to the client via the relay system.


