Unified Cookie Storage for Mini App Cross-Stack Session Management
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Mini app technologies face challenges in managing sessions across different technology stacks, particularly with WebView and NA capabilities, as they cannot uniformly acquire and store cookies, hindering services like resource payment for images and videos.
Innovation Solution
A data processing method and apparatus that intercepts request messages from any technology stack, acquires and stores cookie content from a target server, and returns the data to the appropriate stack, unifying cookie storage and carrying behaviors across different technology stacks within a mini app.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If cookie storage is implemented only in the logic layer through developer self-maintenance, then the logic layer can manage sessions, but WebView and NA capabilities cannot manage sessions uniformly, causing technical troubles
Solution Approach 1:
The patent implements a unified cookie storage mechanism that works across all three technology stacks (logic layer, WebView, and NA capabilities) through a common database interface. The CookieStorageDatabase class provides universal cookie storage functionality that can be accessed by any technology stack, eliminating the need for separate implementation in each stack while maintaining session management capability throughout the mini app ecosystem.
Solution Approach 2:
The patent introduces a standardized cookie storage interface and database structure that acts as an intermediary between different technology stacks and the cookie data. This intermediate layer abstracts the storage mechanism, allowing various stacks to interact with cookie data through a common protocol without directly accessing each other's implementation details, thus resolving the complexity of multi-stack cookie management.
2Reliability
If separate cookie storage mechanisms are used for each technology stack, then each stack can independently manage cookies, but uniform session management across stacks becomes impossible
Solution Approach 1:
The unified CookieStorageDatabase provides a single, reliable storage mechanism that all technology stacks can use consistently. By implementing a common database structure with standardized methods for setting, getting, deleting, and checking cookies, the patent ensures that session management behaves reliably and predictably across logic layer, WebView, and NA capabilities, eliminating the need for stack-specific storage logic.
Solution Approach 2:
The patent enforces homogeneous cookie storage operations across all technology stacks by providing a unified database interface with consistent methods. All stacks interact with cookies through the same set of operations (setCookie, getCookie, deleteCookie, hasCookie), ensuring uniform behavior and simplifying the ease of operation while maintaining reliability across the entire mini app system.
3Ease of manufacture
If cookie data is stored without separation, then storage is simple, but data security between different mini apps is compromised
Solution Approach 1:
The patent segments the cookie storage space by creating separate storage sandboxes for different mini apps using the getAppId() method. Each mini app's cookies are stored in an isolated namespace prefixed with its unique application ID, ensuring that one mini app cannot access another's cookie data. This segmentation maintains implementation simplicity while providing robust data security through automatic namespace isolation.
Solution Approach 2:
The patent implements local quality by providing each mini app with its own dedicated cookie storage sandbox while maintaining a unified database structure. The storage mechanism adapts to local security requirements by automatically isolating data based on application ID, allowing simple unified implementation while ensuring each app's data remains secure and inaccessible to other apps.
Data Source
AI summary
A data processing method and apparatus for a mini app, a device and a medium are provided. An implementation of the method may include: intercepting a request message of the mini app, and sending the request message to a target server, where the request message comes from a technology stack; acquiring returned data targeting at the request message and returned from the target server, where the returned data includes cookie content, field information for indicating storage of the cookie content, and a data set corresponding to the request message; and storing the cookie content into a cookie storage database of the mini app according to the field information, and returning the returned data to the technology stack issuing the request message.


