Cross-domain cookie control method, device and equipment in browser and medium

By installing a pre-configured plug-in in the browser, automatically obtaining and parsing domain name information, calling the browser cookie interface, and implementing encryption and permission control, the complex configuration and security issues in cross-domain cookie management are solved, the convenience and security of cross-domain cookie sharing are achieved, and the user experience is improved.

CN119299161BActive Publication Date: 2025-10-10PING AN BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411403856.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-10-10
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

Existing cross-domain cookie management technology relies on complex server-side configuration and lacks sufficient security protection during cookie transmission, resulting in low development efficiency and poor security, especially in the financial system, where there is a risk of user privacy leakage.

Method used

By installing a pre-configured browser plug-in in the browser, the domain name information of the source site and the target site is automatically obtained and parsed, the protocol prefix is ​​removed, the browser's cookie management interface is called to obtain cookie information, and encryption processing and permission control mechanisms are implemented to ensure that only authorized sites can receive cookie information.

Benefits of technology

It simplifies the operational steps of cross-domain cookie sharing, improves security, prevents data leakage and unauthorized access, enhances user experience, and reduces development and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299161B_ABST
    Figure CN119299161B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data security and the field of financial technology, and discloses a cross-domain Cookie control method in a browser, which comprises the following steps: installing a pre-configured browser plug-in, obtaining a configuration file containing domain name information of a source site and a target site from internal resources of the plug-in, parsing and extracting the domain name information, removing a protocol prefix, calling a Cookie management interface of the browser through the plug-in to obtain Cookie information of the source site, performing encryption processing on the Cookie information, judging whether the target site is authorized through an authority control mechanism, and injecting the encrypted Cookie information into the target site if the authorization is passed. Through installation of the pre-configured browser plug-in, the domain name information is automatically obtained and parsed, the operation steps are simplified, and complex server-side configuration is avoided. Through encryption processing and authority control, the Cookie information has high security in the cross-domain transmission process, data leakage and unauthorized access are effectively prevented, and the security and convenience of cross-domain Cookie sharing are realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data security and financial technology, and particularly relates to a cross-domain Cookie control method and device in a browser, equipment and a storage medium. BACKGROUND

[0002] In the development of financial systems, developers often need to switch between service modules under multiple subdomain names, such as product management, operation management, and approval processes. These modules may be deployed under different domain names or subdomain names, and the traditional Cookie mechanism is limited by the same-origin policy of the browser, which does not allow cross-domain sharing of Cookie information. This results in developers needing to frequently log in when switching between different modules, greatly reducing work efficiency and increasing development difficulty.

[0003] Most existing cross-domain Cookie sharing solutions rely on complex server-side configurations and authentication mechanisms. For example, using Nginx proxy or reverse proxy to achieve Cookie sharing. Such solutions require significant changes to the server side, involving complex configuration processes, which not only increase the implementation difficulty and maintenance cost, but also may pose risks to the existing financial system architecture, especially in terms of security and compliance.

[0004] When sharing Cookie information across domains, data security is particularly important. In existing technologies, some solutions lack effective encryption mechanisms, and Cookie information is easily intercepted or tampered with during transmission, posing a risk of user privacy leakage. In the financial field, user identity authentication information and other sensitive data have very high security requirements, and the security vulnerabilities of existing solutions cannot meet this demand.

[0005] Many existing solutions require manual configuration by the user, such as specifying domain names, configuring Cookie sharing rules, etc., which makes the entire process tedious and prone to errors. For developers of financial systems, frequent manual operations not only reduce development efficiency, but also increase the risk of data sharing failure or security vulnerabilities due to improper configuration. SUMMARY

[0006] The main purpose of the present application is to provide a cross-domain Cookie control method, device, equipment and storage medium in a browser, aiming to solve the technical problems of existing cross-domain Cookie management technologies relying on complex server-side configurations and lacking sufficient security protection during Cookie transmission.

[0007] To achieve the above purpose, the present application provides a cross-domain Cookie control method in a browser, comprising:

[0008] installing a pre-configured browser plug-in in the browser;

[0009] Obtaining a configuration file from the internal resources of the browser plug-in, wherein the configuration file includes preset source site domain name information and target site domain name information;

[0010] Parsing the configuration file, extracting the source site domain name information and the target site domain name information, and removing the protocol prefix in the source site domain name information and the target site domain name information;

[0011] Invoke the browser's cookie management interface through the browser plug-in to capture cookie information from the source site;

[0012] Encrypting the Cookie information through the browser plug-in;

[0013] Implementing a permission control mechanism through the browser plug-in to determine whether the target site has been authorized;

[0014] If the target site has been authorized, the browser's Cookie management interface is called through the browser plug-in to inject the encrypted Cookie information into the target site.

[0015] Furthermore, to achieve the above-mentioned purpose, the present invention provides a cross-domain cookie control device in a browser, comprising:

[0016] A plugin installation module, used to install pre-configured browser plugins in the browser;

[0017] A configuration management module, configured to obtain a configuration file from the internal resources of the browser plug-in, wherein the configuration file includes preset source site domain name information and target site domain name information;

[0018] A configuration parsing module is used to parse the configuration file, extract the source site domain name information and the target site domain name information, and remove the protocol prefix in the source site domain name information and the target site domain name information;

[0019] A cookie management module, configured to call the cookie management interface of the browser through the browser plug-in to capture cookie information from the source site;

[0020] An encryption module, used to encrypt the Cookie information through the browser plug-in;

[0021] The permission control module is used to implement the permission control mechanism through the browser plug-in to determine whether the target site has been authorized;

[0022] The cookie injection module is used to call the cookie management interface of the browser through the browser plug-in if the target site has been authorized, and inject the encrypted cookie information into the target site.

[0023] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a computer device, which includes a memory, a processor, and a cross-domain cookie control program in a browser stored on the memory and runnable on the processor. When the cross-domain cookie control program in the browser is executed by the processor, the steps of the cross-domain cookie control method in the browser as described above are implemented.

[0024] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a cross-domain cookie control program in a browser is stored. When the cross-domain cookie control program in the browser is executed by a processor, the steps of the cross-domain cookie control method in the browser as described above are implemented.

[0025] Beneficial effects: The present invention relates to the fields of data security technology and financial technology, and discloses a cross-domain cookie control method in a browser. By installing a pre-configured browser plug-in, a configuration file containing the domain name information of the source site and the target site is obtained from the internal resources of the plug-in, the domain name information is parsed and extracted, the protocol prefix is ​​removed, and the browser's cookie management interface is called through the plug-in to obtain the cookie information of the source site. The cookie information is encrypted, and a permission control mechanism is implemented to determine whether the target site is authorized. If the authorization is passed, the encrypted cookie information is injected into the target site. The present invention automatically obtains and parses domain name information by installing a pre-configured browser plug-in, simplifies the operating steps, and avoids complex server-side configuration. Through encryption processing and permission control, it ensures that the cookie information has high security during cross-domain transmission, effectively preventing data leakage and unauthorized access. Ultimately, the security and convenience of cross-domain cookie sharing are achieved, the user experience is improved, and the development and maintenance costs are reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0027] Figure 1 A schematic diagram of an application environment of a cross-domain cookie control method in a browser according to an embodiment of the present invention;

[0028] Figure 2 This is a flow chart of an embodiment of a cross-domain cookie control method in a browser of the present invention;

[0029] Figure 3 This is a functional module diagram of a preferred embodiment of the cross-domain cookie control device in a browser of the present invention;

[0030] Figure 4 A schematic diagram of the structure of a computer device according to an embodiment of the present invention;

[0031] Figure 5 FIG. 2 is another structural diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0033] The cross-domain cookie control method in the browser provided by the embodiment of the present invention can be applied to Figure 1 In an application environment, the user terminal communicates with the server terminal via a network. The server terminal can install a pre-configured browser plug-in on the user terminal, obtain a configuration file containing the domain name information of the source site and the target site from the plug-in's internal resources, parse and extract the domain name information, remove the protocol prefix, and call the browser's cookie management interface through the plug-in to obtain the cookie information of the source site. The cookie information is encrypted, and a permission control mechanism is implemented to determine whether the target site is authorized. If the authorization is granted, the encrypted cookie information is injected into the target site. The present invention automatically obtains and parses domain name information by installing a pre-configured browser plug-in, simplifying the operation steps and avoiding complex server-side configuration. Through encryption and permission control, the cookie information is ensured to have high security during cross-domain transmission, effectively preventing data leakage and unauthorized access. Ultimately, the security and convenience of cross-domain cookie sharing are achieved, the user experience is improved, and development and maintenance costs are reduced. The user terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablet computers, and portable wearable devices. The server terminal can be implemented as an independent server or a server cluster consisting of multiple servers. The present invention is described in detail below through specific embodiments.

[0034] See also Figure 2 , Figure 2 This is a flow chart of an embodiment of a cross-domain cookie control method in a browser provided by the present invention. It should be noted that although a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0035] like Figure 2 As shown, the cross-domain cookie control method in the browser proposed by the present invention includes the following steps:

[0036] S10, installing a pre-configured browser plug-in in the browser;

[0037] In this embodiment, installing a pre-configured browser plug-in involves integrating a pre-configured plug-in into the browser environment through the browser's plug-in installation mechanism. The plug-in's internal parameters, such as the source and target site domain names, are already configured by the developer prior to installation, eliminating the need for the user to manually configure any complex server-side parameters. The plug-in installation process is typically completed in a few simple steps, requiring no additional server adjustments.

[0038] A browser plug-in is a software component based on a browser extension framework (such as the Chrome extension) that is designed to enable cross-domain cookie management and sharing. The following describes the implementation of the plug-in in detail, including the design and implementation of each functional module, technology selection, data processing flow, and security measures. JavaScript is primarily used, combined with HTML and CSS, to construct the user interface. Cookie management and data storage operations are performed using the Chrome extension API (such as chrome.cookies and chrome.storage). Data encryption and decryption are implemented using the Web Crypto API or third-party encryption libraries (such as CryptoJS).

[0039] The plug-in mainly consists of the following core modules:

[0040] Installation Module: Responsible for the installation process of the plug-in, including guiding the user to complete the installation and initializing basic configuration.

[0041] Configuration Management Module (ConfigurationManagementModule): manages the configuration files of the plug-in, stores and reads the domain name information of the source site and the target site.

[0042] Configuration Parsing Module: parses the configuration file, extracts the domain name information of the source and target sites, and removes the protocol prefix.

[0043] Cookie Management Module: interacts with the browser's Cookie Management interface, captures Cookie information from the source site, and performs preliminary filtering.

[0044] Encryption Module: Encrypts the captured cookie information to ensure the security of data transmission and storage.

[0045] Permission Control Module: manages and determines the authorization status of the target site to ensure that only authorized sites can receive shared cookie information.

[0046] Cookie Injection Module: Injects encrypted cookie information into authorized target sites to ensure the correct delivery and application of cookies.

[0047] Users access the browser's plug-in store or the download link provided by the company, select and begin downloading the plug-in. The browser prompts the user to confirm the installation. Once the user clicks "confirm," the plug-in is automatically installed and displayed in the browser's list of extensions. Once installed, the browser automatically enables the plug-in and, based on pre-configured information, initiates background services related to cookie sharing. The plug-in manages cookie acquisition, encryption, and injection in the background without requiring further user configuration. Users can view the plug-in's icon or settings interface on the browser interface to check its operating status, but do not need to modify any configuration.

[0048] Example: In financial system development, developers often need to frequently switch between service modules under multiple subdomains. By installing a pre-configured browser plugin, developers can avoid repeated login operations under each subdomain and ensure that identity authentication information is automatically shared across subdomains.

[0049] By installing a pre-configured plug-in in the browser, users can avoid manually configuring complex cross-domain cookie sharing rules, reducing the difficulty of use. At the same time, the plug-in runs automatically in the background, without the need for additional server-side configuration, greatly simplifying the operation process of cross-site cookie management.

[0050] S20, obtaining a configuration file from the internal resources of the browser plug-in, wherein the configuration file includes preset source site domain name information and target site domain name information;

[0051] In this embodiment, a configuration file is retrieved from resources within the browser plug-in. This configuration file contains the domain name information of the preset source and target sites. The configuration file is typically stored in JSON format and records which sites require cookie sharing. By reading this configuration file from the plug-in's internal resources, the plug-in can automatically obtain the required domain name information, eliminating manual user input and ensuring the consistency and accuracy of the domain name information.

[0052] The internal resources of a plug-in refer to the files that come with the plug-in when it is installed. These files are stored in the plug-in's internal storage module and are not visible to the outside world (users). A typical configuration file is domain.json, which contains site information shared across domains. The configuration file is usually a JSON file containing two main fields: The source site domain name information (from) represents the site the user is visiting, and the plug-in needs to obtain cookies from this site. The target site domain name information (to) represents the site that receives the shared cookies, and the plug-in will share the cookie information captured from the source site to this site.

[0053] When the plug-in is initialized, the browser loads the plug-in's internal resources. The plug-in obtains the path of the configuration file through a built-in API (such as chrome.runtime.getURL). Once the path is confirmed, the plug-in calls the file reading function to obtain and load the contents of the configuration file from the path. After reading the configuration file, the plug-in parses it into an operable data structure (such as a JavaScript object) for subsequent cookie sharing operations. After reading and parsing the configuration file, the plug-in saves the domain name information in memory, waiting for subsequent cookie operations. This domain name information is referenced throughout the plug-in operation to determine the source and target sites for cross-domain cookie sharing.

[0054] Example: In financial systems, different modules (such as customer management systems and loan approval systems) are often deployed on different subdomains. Developers can install a pre-configured browser plug-in, which automatically retrieves configuration files from internal resources, including the domain names of the source and target sites. For example, https: / / cms.finance.com is the source site, and https: / / las.finance.com is the target site. The plug-in automatically extracts this domain name information, eliminating the need for developers to manually enter it, ensuring accurate and efficient cross-site sharing operations.

[0055] By retrieving configuration files from its internal resources, the plugin automatically retrieves the domain information required for cross-site cookie sharing, eliminating manual entry errors and complex operations. This ensures the security and consistency of configuration files, improves the user experience, and reduces complexity.

[0056] S30, parsing the configuration file, extracting the source site domain name information and the target site domain name information, and removing the protocol prefix in the source site domain name information and the target site domain name information;

[0057] In this embodiment, the domain name information of the source site and the target site is extracted from the configuration file and processed to remove unnecessary protocol prefixes (such as http: / / or https: / / ). This is to ensure that only clean domain name strings are used in subsequent Cookie operations without including the protocol part. Extracting and processing domain name information can ensure the standardization of domain name format, making subsequent operations more accurate and efficient.

[0058] The plugin first reads the configuration file stored in the internal resource, which records the domain name information of the source site and the target site in JSON format. The plugin extracts the two required fields, source site domain name and target site domain name, by parsing the JSON file.

[0059] After parsing the JSON file, the plugin extracts the two main fields: from (source site) and to (target site). The extracted domain name information may contain protocol prefixes (such as http: / / or https: / / ), which are unnecessary in cross-site operations, so they need to be removed.

[0060] To remove the protocol prefix, the plugin uses regular expressions or URL parsing functions to ensure that http: / / or https: / / is removed from the domain name and only the core part of the domain name (such as source-site.com) is retained. This operation can be achieved through the native URL parsing tools provided by the browser or by manually writing regular expressions to ensure that the protocol prefix is accurately removed.

[0061] After removing the protocol prefix, the plugin stores the extracted clean domain name in memory and prepares for subsequent cross-site Cookie operations. This step ensures the standardization of domain name format, avoiding errors in Cookie sharing due to inconsistent formats.

[0062] Example: In a financial system, developers need to switch between different modules, such as from https: / / cms.finance.com (customer management system) to https: / / las.finance.com (loan approval system). When the plugin parses the configuration file, the domain names of the source site and the target site may contain protocol prefixes. By removing these prefixes, the plugin ensures that only the core part of the domain name is used in subsequent Cookie sharing operations, avoiding errors caused by protocol prefixes and ensuring seamless sharing and switching between different modules in the financial system.

[0063] By parsing the configuration file and removing the protocol prefix from the domain name, it ensures the use of standardized domain name information in cross-domain Cookie sharing, avoiding format inconsistency problems caused by protocol prefixes.

[0064] S40, calling the browser's cookie management interface through the browser plug-in to capture cookie information from the source site;

[0065] In this embodiment, a browser plug-in is used to obtain cookie information from a specified source site through the browser's cookie management interface. Cookies are small data files stored in the user's browser that record the user's login status, session information, and preferences. The browser's cookie management interface allows the plug-in to access and obtain cookie information under a specific domain name, thereby enabling cross-domain sharing and data transmission.

[0066] Browsers provide a dedicated API for managing and manipulating cookies (for example, the Chrome browser's chrome.cookies.getAll API). A plug-in calls this API to retrieve the currently stored cookies from the source site. When calling the API, the plug-in needs to pass the source site's domain name as a parameter, and the API will return all cookie information associated with that domain.

[0067] To access cookies, plugins must obtain the appropriate permissions granted by the user. When installing a plugin, the browser asks the user to grant cookie access permissions. Without user authorization, plugins cannot access or manipulate cookies. Plugins ensure access to origin site cookies through permissions defined in the manifest.json file.

[0068] Plugins can specify retrieval criteria based on domain names, ensuring that only cookies related to the originating site are retrieved. For example, this can be done by retrieving only cookies for the currently active window, or cookies for a specific path or subdomain. In practice, plugins only need to retrieve cookies related to user authentication, ensuring that users do not need to log in to other modules after cross-domain sharing.

[0069] When the plugin calls the API to retrieve cookie information, the browser returns a list of all eligible cookies. Each cookie object contains multiple attributes, such as name, value, domain, path, expiration time, and secure flag. The plugin then filters this cookie information, eliminating irrelevant cookies and ensuring that only the required authentication or session cookies are shared.

[0070] The captured cookie information is temporarily stored in the plugin's memory, awaiting further processing, such as encryption and transmission. The plugin can also encrypt these cookies to ensure data security during subsequent cross-site transmission.

[0071] Example: In a financial system, when a user logs in to https: / / cms.finance.com (the customer management system), the browser stores a cookie containing their authentication information. To seamlessly log in to https: / / las.finance.com (the loan approval system), a developer-installed plug-in automatically captures the relevant authentication cookies from the source site (the customer management system) through the browser's cookie management interface. This operation requires no manual user intervention; the plug-in automatically retrieves the login cookie information, ensuring that users do not need to log in again when switching to the loan approval system, thereby improving system operational efficiency and user experience.

[0072] By invoking the browser's cookie management interface, the plug-in automatically captures user authentication cookies from the source site, eliminating the tedious manual export and import of cookies. This process ensures efficient capture and accurate sharing of cookie information, laying the foundation for subsequent cross-site sharing and improving the user experience.

[0073] S50, encrypting the Cookie information through the browser plug-in;

[0074] In this embodiment, captured cookie information is encrypted using a browser plug-in to ensure data security during cross-site transmission. The primary purpose of encryption is to protect cookie information from malicious interception or tampering during transmission. The encryption algorithm ensures that cookie information can only be decrypted and used by authorized sites.

[0075] When a plugin is installed or launched for the first time, it initializes an encryption module to handle the encryption of all sensitive data. This module, typically integrated into the plugin's background script, encrypts data using a secure encryption algorithm. Plugins can use asymmetric encryption (such as RSA) or symmetric encryption (such as AES) to ensure data security. Asymmetric encryption can be used to ensure that only the intended site can decrypt the data.

[0076] When performing encryption operations, the plugin generates a random encryption key. The length and complexity of the key depend on the encryption algorithm used. For example, AES encryption typically uses a 128-bit or 256-bit key. This random key can be generated using the browser's secure random number generator, ensuring that the encryption key is highly secure and difficult for attackers to guess or crack.

[0077] Captured cookie information includes attributes such as the cookie name, value, path, and expiration time. The plugin encrypts this information, especially the cookie value (such as a user's authentication token or session information), as this information is often the most sensitive. Encryption converts the cookie value from plaintext to ciphertext, ensuring that it cannot be directly read or modified during transmission.

[0078] Once encryption is complete, the plugin stores the encrypted cookie information in memory, ready for transmission to the target site. This encrypted data can be temporarily stored in the plugin's internal storage, awaiting a request from the target site. Through the plugin's control, encrypted cookies can only be accessed by authorized sites, ensuring they cannot be obtained by unauthorized third parties.

[0079] The plugin can select different encryption algorithms based on the system's security requirements or user preferences. For example, RSA encryption is suitable for ensuring data security on the public internet, while AES encryption can be used to quickly encrypt large amounts of data. The plugin ensures that the encryption algorithm meets modern security standards and regularly updates encryption keys and algorithms to prevent algorithms from becoming outdated or keys from being compromised.

[0080] Example: In a financial system, when a user logs in to https: / / cms.finance.com (customer management system), the system generates user authentication cookies. These cookies contain the user's identity token or session ID. To share this information with https: / / las.finance.com (loan approval system), a plugin captures these cookies and encrypts them. Using the RSA encryption algorithm, the cookie information is securely encrypted, allowing only the loan approval system to decrypt and read it, ensuring the security and integrity of the user's identity information. This encryption is crucial in the financial sector, preventing malicious attackers from accessing or tampering with sensitive user information during cross-site transmission.

[0081] By encrypting captured cookie information, the plugin significantly improves data security during transmission, preventing cookie information from being intercepted or tampered with by third parties. This encryption ensures that only authorized sites can read and decrypt cookie information, significantly reducing the risk of data leakage and ensuring user privacy and data security.

[0082] S60, implementing a permission control mechanism through the browser plug-in to determine whether the target site has been authorized;

[0083] In this embodiment, a permission control mechanism is implemented through a plug-in to determine whether the target site is authorized to receive shared cookie information. The purpose of the permission control mechanism is to ensure that only verified or pre-authorized target sites can receive and use cookie data from the source site. Unauthorized sites will not be able to access sensitive cookie information, which can effectively prevent data leakage or unauthorized access.

[0084] When the plugin is installed, a permission control module is initialized. This module manages and determines whether the target site has permission to receive cookies. The plugin maintains a permission whitelist containing the domain names of all authorized sites. Each time a cross-domain cookie sharing operation is performed, this module is called to check whether the target site is on the whitelist.

[0085] Before performing cross-domain cookie sharing, the plugin obtains the domain name of the current target site. This is typically done by passing the target site's domain name as a parameter when calling the browser's cookie settings interface. This domain name can be directly extracted from the plugin's configuration file (e.g., defined in domain.json) or dynamically set via user input.

[0086] The plugin uses the permission control module to match the target site's domain name with a pre-defined whitelist of permissions. This whitelist contains a list of all sites authorized to receive cookies. If the target site's domain name matches an entry in the whitelist, the site is authorized to share cookies.

[0087] If the target site is not on the whitelist, the plugin blocks the cookie sharing operation. In this case, the plugin can issue a warning to the user or log a message stating that the site is not authorized and denying cookie injection. The plugin can also optionally provide manual authorization based on user interaction, allowing users to dynamically adjust the permission whitelist.

[0088] The permission whitelist can be updated dynamically, for example, by an administrator updating the list of authorized sites through the company's internal system, or by adjusting the scope of authorization in real time based on user actions. The plugin checks and updates the permission whitelist each time it is started, ensuring the latest authorization rules are in effect and preventing unauthorized access caused by outdated authorization rules.

[0089] The plugin logs the results of each permission check, whether granted or denied. This log includes the timestamp, the target site domain, and the permission check result. This helps track the history of permission checks during later troubleshooting or security audits.

[0090] Example: In a financial system, users may need to switch between system modules under multiple subdomains, for example, switching from https: / / cms.finance.com (customer management system) to https: / / las.finance.com (loan approval system). Thanks to the plugin's permission control mechanism, the loan approval system's domain name is whitelisted, allowing it to securely receive the user's authentication cookie information. However, if a user attempts to share cookie information with an unauthorized third-party site, https: / / external-site.com, the plugin will automatically reject the operation, protecting sensitive user data from being leaked. This mechanism ensures that sharing between modules within the financial system is secure and prevents leakage to unauthorized external sites.

[0091] By implementing a permission control mechanism, the plugin ensures that only authorized target sites can receive and use shared cookie information. This mechanism effectively prevents unauthorized sites from accessing sensitive data, enhancing system security and data privacy. The plugin automatically performs permission checks when handling cross-domain cookie sharing, reducing manual user operations and improving system automation and security.

[0092] S70: If the target site has been authorized, the browser's Cookie management interface is called through the browser plug-in to inject the encrypted Cookie information into the target site.

[0093] In this embodiment, once the target site passes the permission check and obtains authorization, the browser plug-in injects the previously encrypted cookie information into the target site through the browser's cookie management interface. This process ensures that only authorized sites can receive the encrypted cookie information and use it for authentication or session management. This step ensures data security and prevents unauthorized sites from accessing cookie information.

[0094] The plugin first checks the authorization status of the target site. If the target site matches the whitelist in the permission control module and is confirmed to be authorized to receive cookie information, the plugin will proceed to the next step of the process. If not, the cookie injection operation will be terminated and a denial log will be recorded.

[0095] The plugin calls the browser's cookies.set() interface to inject the encrypted cookie information into the target site. This interface allows you to set the target site's domain name, cookie name, encrypted value, expiration date, path, and other information. Based on a configuration file or dynamically set parameters, the plugin sends these encrypted cookies to the target site so that the site can use them for user authentication.

[0096] Encrypted cookie information includes securely encrypted cookie values ​​(such as session IDs or identity tokens). This data is encrypted during transmission, and only the target site can decrypt and use the cookie information. The plugin ensures that each injected cookie has the correct domain name, path, and other attributes, ensuring that the target site can correctly receive and use the cookies.

[0097] The plugin can set an expiration date for each injected cookie, ensuring it's valid only for a specified period. If the target site requires long-term session retention, the plugin can set a longer expiration date; otherwise, the default is a short-term session. The plugin also automatically expires cookies based on security requirements, automatically deleting them after the user leaves the target site, enhancing security.

[0098] The plugin automatically logs each successful or failed cookie injection operation, including the injection time, target site, cookie information, and results. If the injection is successful, the plugin records the success event for subsequent query; if the injection fails, the plugin records the failure reason to help developers troubleshoot the problem.

[0099] Example: In a financial system, when a user successfully logs in from https: / / cms.finance.com (the customer management system), the plug-in automatically captures and encrypts the user's authentication cookie. When the user accesses https: / / las.finance.com (the loan approval system), the plug-in first checks whether the site is on the authorized whitelist. After confirming authorization, the plug-in injects the encrypted user authentication cookie into the loan approval system through the browser's cookie management interface, eliminating the need for the user to log in again. This operation ensures secure authentication and seamless integration between submodules within the financial system, improving the user experience while ensuring the security of sensitive information during transmission.

[0100] Through an authorization mechanism, only authorized target sites can receive encrypted cookie information and use it for authentication or session management. Encryption and injection mechanisms effectively enhance data transmission security, preventing unauthorized sites from accessing sensitive user information. Furthermore, the plugin's automated injection and logging capabilities enhance the user experience and reduce the complexity of manual configuration.

[0101] The present invention relates to the fields of security technology and financial technology, and discloses a cross-domain cookie control method in a browser. By installing a pre-configured browser plug-in, a configuration file containing domain name information of a source site and a target site is obtained from the internal resources of the plug-in, the domain name information is parsed and extracted, the protocol prefix is ​​removed, and the cookie information of the source site is obtained by calling the browser's cookie management interface through the plug-in. The cookie information is encrypted, and a permission control mechanism is implemented to determine whether the target site is authorized. If the authorization is passed, the encrypted cookie information is injected into the target site. The present invention automatically obtains and parses domain name information by installing a pre-configured browser plug-in, simplifies the operation steps, and avoids complex server-side configuration. Through encryption processing and permission control, the cookie information is ensured to have high security during cross-domain transmission, effectively preventing data leakage and unauthorized access. Ultimately, the security and convenience of cross-domain cookie sharing are achieved, the user experience is improved, and the development and maintenance costs are reduced.

[0102] In one embodiment, the above S10 includes:

[0103] S101, setting an installation wizard, wherein the installation wizard is used to guide the user to install the browser plug-in in the browser;

[0104] S102, during the installation process, configuring the browser plug-in through a graphical user interface, the configuration process including inputting source site domain name information and target site domain name information;

[0105] S103, detecting whether the source site domain name information and the target site domain name information comply with domain name naming standards;

[0106] S104, if the source site domain name information and the target site domain name information do not conform to the domain name naming standard, prompting to reconfigure valid domain name information;

[0107] S105, saving the source site domain name information and the target site domain name information that comply with the naming standard into the internal storage module of the browser plug-in, and generating the configuration file.

[0108] In this embodiment, the purpose of the installation wizard is to simplify the plug-in installation process for users, allowing them to easily complete the plug-in installation through step-by-step instructions. The wizard typically appears in the form of a graphical user interface (GUI) and guides users through necessary configuration operations, such as entering the site domain information and agreeing to plug-in permissions. Using the installation wizard, users can avoid complex manual settings and ensure the correct installation and configuration of the plug-in.

[0109] The plug-in installation package comes with a built-in installation wizard. This wizard automatically launches when users download the plug-in from a browser plug-in store or through internal enterprise systems. The wizard uses a user-friendly graphical interface to step through the necessary steps, including selecting an installation path and agreeing to permissions (such as accessing cookies and reading and writing internal storage). During the installation process, users do not need to manually modify any files or code; the wizard automatically manages all steps.

[0110] During the plugin installation process, users enter the domain names of the source and target sites through the graphical user interface (GUI). This configuration step provides the plugin with the domain name information necessary for cross-site cookie sharing, ensuring proper cookie transfer between sites. Users simply enter the domain name information in the input box, eliminating the tedious process of manually modifying the configuration file.

[0111] The installation wizard provides input boxes, prompting users to enter the domain names of the source and target sites, such as https: / / cms.finance.com and https: / / las.finance.com. The plugin interface displays concise prompts to guide users in entering the correct domain name format. Once the user completes the input, the plugin temporarily stores this information and prepares for the next step, domain name format verification.

[0112] After the user enters their domain name, the plugin automatically checks whether the entered domain name conforms to the standard domain name format. Domain naming standards generally require that the domain name structure conform to a common format (such as suffixes like .com and .org) and that the domain name does not contain illegal characters. This step ensures that the entered domain name is legal, which helps with subsequent cross-site cookie sharing operations.

[0113] The plug-in includes built-in domain name validation, using regular expressions or the browser's native URL parsing tools to check the source and target domain names entered by the user. This validation logic includes checking whether the domain name contains illegal characters, lacks a top-level domain (such as .com or .net), and contains non-compliant protocol prefixes (such as misspellings of http: / / ). If validation passes, the plug-in proceeds to the next step; if validation fails, the user is prompted to make corrections.

[0114] If the domain name entered by the user does not meet the domain name standards, the plug-in will inform the user through a pop-up window or prompt message that they need to re-enter the correct domain name information. This step is to prevent users from entering incorrect domain names and causing subsequent cookie sharing operations to fail.

[0115] If the extension detects an invalid domain name format, it will prompt the user to correct it through a pop-up window, red warning text, or by highlighting the incorrectly entered domain name. The prompt will include a link to help documentation or format examples to guide the user in entering the correct domain name. The user can follow the prompts to re-enter the valid domain name until verification is successful.

[0116] Once the source and target domain names entered by the user are verified, the plugin will store them in its internal storage and generate a corresponding configuration file. This configuration file records the domain name information used for cross-site cookie sharing, which the plugin can call at any time to perform cross-domain operations during runtime.

[0117] The plugin saves the verified domain information to internal storage, typically the browser plugin's localStorage or a similar storage mechanism. The plugin generates a configuration file (such as domain.json) that records the source and destination domain information entered by the user in JSON format. Once the configuration file is generated, the plugin automatically calls it during runtime to ensure that the correct domain information is used when sharing cookies across sites.

[0118] This embodiment simplifies the process of configuring source and target site domain names by providing an installation wizard and a graphical user interface, eliminating the need for complex manual configuration file editing. Domain name format validation ensures that users enter valid domain name information, reducing the possibility of operational errors. Ultimately, the generated configuration file provides accurate domain name data for subsequent cross-domain cookie sharing operations, improving operational security and user experience.

[0119] In one embodiment, the above S30 includes:

[0120] S301, using the browser plug-in to parse the domain name information in the configuration file using a regular expression to extract the source site domain name information and the target site domain name information;

[0121] S302, using a preset protocol prefix format, identifying whether the domain name strings of the source site domain name information and the target site domain name information have a protocol prefix;

[0122] S303: If a protocol prefix is ​​identified, remove the protocol prefix from the source site domain name information and the target site domain name information;

[0123] S304, verifying whether the source site domain name information and the target site domain name information after removing the protocol prefix conform to the domain name format specification;

[0124] S305: If the source site domain name information or the target site domain name information after removing the protocol prefix does not conform to the domain name format specification, an error message is recorded and the user is prompted to make corrections.

[0125] In this embodiment, the plug-in uses regular expressions to parse the domain name information in the configuration file to extract the domain names of the source and target sites. The configuration file is typically in JSON format and stores the domain name information of the source and target sites. Regular expressions quickly locate and extract domain names by matching specific string formats (such as letters, numbers, and special symbols in the domain name).

[0126] The plugin reads an internally stored configuration file (such as domain.json), which contains the full URLs of the source and target sites. It uses regular expressions to extract the domain name. For example, if a URL formatted like https: / / source-site.com is matched, the source-site.com portion is extracted as the source site domain name. A similar process is used to extract the target site's domain name.

[0127] Check the extracted domain name using a pre-set protocol prefix (such as http: / / or https: / / ). The protocol prefix indicates the network communication protocol (HTTP or HTTPS). However, in cross-domain cookie sharing, the core part of the domain name (such as source-site.com) is more important, so the prefix needs to be removed.

[0128] When parsing a domain name, the plugin checks the domain name string for the http: / / or https: / / prefix using a regular expression. If a protocol prefix is ​​detected, it marks it as removable and prepares for the next step of processing.

[0129] When the plug-in detects a protocol prefix in a domain name, it automatically removes it and retains the core part of the domain name (such as source-site.com), making the domain name format more concise and suitable for subsequent cross-domain operations.

[0130] Use string manipulation functions (such as replace in JavaScript) to remove the matched protocol prefix from the domain name. For example, process https: / / source-site.com as source-site.com to ensure that the domain name format meets the requirements for cross-domain operations.

[0131] After removing the protocol prefix, the plugin needs to verify that the remaining domain name conforms to the domain name format specification. The domain name specification requires that the domain name has the correct structure, such as the presence of legal characters, a top-level domain (such as .com or .org), and does not contain illegal characters.

[0132] Use regular expressions or the URL parsing tool provided by your browser to verify the format of the domain name after removing the protocol prefix to ensure that the domain name is legal. Verify that the domain name contains the top-level domain (such as .com, .net) and does not contain illegal characters or spaces.

[0133] If the domain name doesn't conform to the standard format after removing the protocol prefix, the plugin will log an error message and prompt the user through a pop-up window or prompt box to indicate that the domain name entered is incorrect, requiring the user to re-enter the correct domain name information. This step ensures that the user enters a valid domain name and prevents errors in subsequent operations.

[0134] The plugin logs any errors it detects (such as invalid domain name formats) to facilitate troubleshooting by developers or users. The plugin uses a graphical user interface (GUI) to notify users that the domain name does not meet requirements and guides them to re-enter the correct domain name. After the user enters the correct domain name, the plugin performs domain name validation again until the format meets the requirements.

[0135] Example: In financial systems, different modules are often deployed under multiple subdomains, such as the customer management system (https: / / cms.finance.com) and the loan approval system (https: / / las.finance.com). The plugin parses these domain names and removes the protocol prefix to ensure that the domain name format is concise and compliant when sharing user authentication information across sites. If the entered domain name format is incorrect (such as missing the top-level domain), the plugin will prompt the user to correct it, ensuring smooth cross-domain operations and reducing errors.

[0136] This implementation uses regular expressions to parse domain name information in the configuration file and removes protocol prefixes, ensuring clean domain name formats are used in cross-site operations, thereby improving operational accuracy. Furthermore, domain name format validation and user prompts prevent cross-domain failures caused by incorrect input, improving operational reliability and user experience.

[0137] In one embodiment, the above S40 includes:

[0138] S401, configuring a capture condition list, wherein the capture condition list is used to specify a URL pattern for capturing cookies from a source site;

[0139] S402, calling the browser's cookie management interface through the browser plug-in, and passing the capture condition list as a parameter to the cookie management interface, for requesting the browser to filter and provide all cookies that meet the capture conditions according to the capture condition list;

[0140] S403, receiving the cookie list returned by the browser through the browser plug-in, and filtering it according to predetermined rules;

[0141] S404: Check the attributes of each cookie, including the domain, path, and security flag, to determine whether the cookie is suitable for cross-domain sharing;

[0142] S405, for each cookie that passes the attribute check, verify whether there is user consent or policy allowing the cookie to be shared across domains;

[0143] S406: Store the verified Cookie in the memory or the internal storage module of the browser plug-in.

[0144] In this embodiment, the capture condition list refers to the URL matching pattern set by the plug-in when obtaining cookies from the source site, which is used to specify the URLs from which cookies are captured. These conditions can be set based on information such as domain name, path, protocol, etc., ensuring that the plug-in only obtains cookies that meet the conditions and avoids obtaining irrelevant cookie data.

[0145] When the plugin starts, it defines a list of capture conditions, including the source site's domain name, path, and possible protocol (http or https). For example, the capture condition could be limited to https: / / source-site.com / *, ensuring that only cookies from all paths under source-site.com are captured. These conditions can be adjusted based on user needs, for example, to capture only login-related cookies while ignoring other less important cookies.

[0146] The plugin uses the browser's cookie management interface (such as chrome.cookies.getAll) to request the browser to filter and return cookies that meet the conditions according to the capture condition list. The capture condition list is passed to the API as a parameter to ensure that only cookies that meet the conditions are returned.

[0147] The plugin calls the browser's cookies.getAll method and passes the previously defined capture criteria as parameters. For example, the plugin might pass the following parameters: {domain:'source-site.com',path:' / ',secure:true}. The browser uses these parameters to filter all cookies matching the criteria for the current domain and returns them to the plugin for further processing. This process ensures that only cookies associated with the source site are captured, preventing cookies from other domains from being accidentally captured.

[0148] After receiving a list of eligible cookies from the browser, the plug-in filters them according to pre-set rules. These rules can include information such as the cookie's expiration date, purpose, and path. Through filtering, the plug-in can further narrow the scope of cookies, retaining only those that need to be shared.

[0149] The cookie list returned by the browser contains multiple cookie objects, each of which includes attributes such as the cookie's name, value, path, domain name, and expiration time. The plug-in filters out unnecessary cookies based on pre-defined filtering rules (such as only retaining cookies with an unexpired validity period or cookies under a specified path). For example, you can only retain cookies under the path / login. The filtered cookie list will be used for subsequent cross-domain sharing processing.

[0150] Each cookie has multiple attributes, such as domain, path, expiration time, and secure flag. The plugin needs to check these attributes to ensure that the cookie meets the requirements for cross-domain sharing. For example, some cookies may have the HttpOnly or Secure flag set, which means that these cookies can only be used in secure connections and are not suitable for cross-domain sharing.

[0151] The plugin examines each cookie's attributes one by one, focusing on the domain (to determine if it belongs to the origin site), the path (to determine the scope of the cookie), and the security flag (such as Secure or HttpOnly). If a cookie is found with the HttpOnly flag, the plugin will not share it, as this flag indicates that the cookie can only be used via HTTP and cannot be read through JavaScript. After the attribute check, only cookies that meet the cross-domain sharing requirements will proceed to the next step.

[0152] In some cases, cross-domain sharing of cookies requires user consent or compliance with the system's sharing policy. The plugin will further check whether these cookies comply with the cross-site sharing policy to ensure that they do not violate the privacy policy or user settings.

[0153] The plug-in checks whether the user has consented to cross-domain cookie sharing through the browser's privacy settings. For example, if the user has enabled the "Block third-party cookies" option in their browser, the plug-in will not share these cookies. The plug-in can also verify which cookies can be shared across domains based on predefined policies. For example, only session cookies or authentication cookies are allowed to be shared, and other sensitive data cookies are not shared. After user consent or policy verification, eligible cookies are marked as shareable.

[0154] Cookies that pass verification are temporarily stored in the plugin's memory or internal storage, awaiting subsequent encryption and cross-domain sharing operations. This step ensures that these cookies can be quickly accessed and transmitted when needed. The plugin stores verified cookies in memory for subsequent processing and encryption. If these cookies need to be saved for a long time, the plugin can choose to store them in the browser plugin's internal storage module (such as localStorage) to ensure that these cookies can still be accessed in subsequent browser sessions.

[0155] This embodiment configures a capture condition list and uses the browser's cookie management interface to enable the plug-in to accurately capture cookies from the source site. It then filters and checks attributes based on pre-defined rules, ensuring that only cookies that meet the cross-domain sharing criteria are processed. This mechanism improves the security and accuracy of cross-site sharing while avoiding unnecessary cookie transmission, ensuring the privacy and security of user data.

[0156] In one embodiment, the above S50 includes:

[0157] S501, setting an encryption module in the browser plug-in, wherein the encryption module is used to perform encryption processing of Cookie information;

[0158] S502, selecting a target encryption algorithm from a predefined encryption algorithm list based on the browser's security requirements and the user's security preference settings;

[0159] S503, generating a random key by using a random number generator through the encryption module, wherein the length and complexity of the random key match the target encryption algorithm;

[0160] S504: Encrypt the Cookie information using the random key and the target encryption algorithm through the encryption module to generate encrypted Cookie data;

[0161] S505: Store the encrypted Cookie data in a memory or an internal storage module of a browser plug-in.

[0162] In this embodiment, an encryption module is built into the plugin to handle the encryption of cookie information. The encryption module's primary function is to convert captured sensitive data (such as cookies) into ciphertext using an encryption algorithm, ensuring that this data cannot be accessed by unauthorized third parties during transmission or storage. The encryption module is integrated into the plugin and automatically handles all encryption tasks, eliminating the need for manual user intervention.

[0163] When the plugin is initialized, it loads and activates the encryption module, which is usually implemented using a JavaScript encryption library (such as CryptoJS or Web CryptoAPI). The encryption module integrates with the browser's security mechanism to ensure that the captured cookie data is encrypted before being stored or transmitted.

[0164] The plug-in selects the most appropriate encryption method from a set of predefined algorithms based on the browser's security settings and user preferences. These algorithms may include symmetric algorithms (such as AES) and asymmetric algorithms (such as RSA). The plug-in dynamically selects an algorithm based on specific security requirements (such as high security or high efficiency).

[0165] The plugin pre-defines a set of secure encryption algorithms, including common ones like AES (symmetric encryption) and RSA (asymmetric encryption). The plugin automatically selects the most appropriate encryption algorithm for the scenario based on user settings or the browser's security configuration (such as whether high-security mode is enabled). For example, if you need to encrypt a large amount of data quickly, you might choose AES, while if you require higher security and the data volume is small, you might choose RSA.

[0166] The encryption key used in the encryption process is generated using a random number generator. The key's length and complexity match the chosen encryption algorithm. The random key is a crucial component of ensuring data security during the encryption process, and the key's strength directly determines the security of the encrypted data.

[0167] The plugin uses the browser's built-in secure random number generator (e.g., window.crypto.getRandomValues) to generate random keys, ensuring they are highly unpredictable and secure. The generated key length depends on the selected encryption algorithm. For example, AES encryption may require a 128-bit or 256-bit key, while RSA encryption may require a 2048-bit key. The plugin ensures that the random key is complex enough to withstand potential brute-force attacks.

[0168] The plugin encrypts the captured cookie information using a previously generated random key and the target encryption algorithm. The encrypted cookie information is stored and transmitted in ciphertext, ensuring that the data cannot be read or modified by unauthorized entities during transmission.

[0169] After receiving the cookie information, the plugin invokes the selected encryption algorithm (such as AES or RSA) through the encryption module and encrypts the cookie using a generated random key. For example, with AES encryption, the plugin encrypts each cookie value, converting the plaintext cookie value into ciphertext. The ciphertext can only be restored to its original value with the decryption key. The encrypted cookie information is converted into unreadable ciphertext, ensuring security during data transmission.

[0170] After encryption is complete, the plug-in will temporarily store the encrypted cookie information in memory or in the plug-in's internal storage (such as the browser's localStorage) so that it can be quickly accessed and transmitted to the target site when needed. This process ensures that the encrypted cookie data will not be exposed to the outside world and can only be accessed by the plug-in and the target site.

[0171] The plugin first stores the encrypted cookie information in memory, ensuring that this data is available during the current session. If these cookies need to be stored for a longer period of time, the plugin can store the encrypted data in localStorage or other plugin-internal storage to ensure that the data remains accessible after the browser is closed. The encrypted data in memory is periodically cleared to prevent performance degradation caused by excessive data.

[0172] This embodiment implements an encryption module within the browser plug-in, enabling it to securely encrypt captured cookie information, ensuring that the data cannot be accessed by unauthorized entities during transmission and storage. Selecting an appropriate encryption algorithm and generating a highly secure random key further enhances data security and resistance to cracking. The encrypted data is stored in the plug-in's memory or internal storage, ensuring the security of cross-site cookie sharing.

[0173] In one embodiment, the above S60 includes:

[0174] S601, setting an authority control module in the browser plug-in, wherein the authority control module is used to control and determine the authorization status of the site;

[0175] S602, when the browser plug-in is installed or first run, the permission control module initializes a permission whitelist, wherein the permission whitelist includes domain names of sites that have been approved to receive cross-domain cookies;

[0176] S603, obtaining the target site domain name information of the current request through the permission control module before each cookie injection operation;

[0177] S604, using a preset matching rule by the permission control module, matching the target site domain name information with entries in the permission whitelist to determine whether the target site has been authorized;

[0178] S605: If the target site domain name information matches an entry in the permission whitelist, it is confirmed that the target site has been authorized, and cookie injection is authorized through the permission control module;

[0179] S606: If the target site domain name information does not match an entry in the permission whitelist, it is determined that the target site is not authorized, and the permission control module rejects cookie injection.

[0180] In this embodiment, the permission control module is a key component in the browser plug-in, which is used to determine whether the target site has the right to receive cross-domain shared cookie information. This module manages and controls the authorization operation of the site, ensuring that only authorized sites can receive shared cookie information.

[0181] During initialization, the plugin loads the permission control module, which is responsible for storing and managing the authorization status of target sites. The permission control module dynamically updates the authorization status, allowing sites to be added or removed during subsequent runs. The plugin can use the permission control module to restrict which sites can receive cookies based on business needs.

[0182] When the plugin is installed or first run, it initializes a whitelist through the permission control module. This whitelist contains authorized site domains. These sites have been approved by the system or user to receive cross-domain shared cookies. The whitelist's purpose is to pre-screen target sites that can share cookies, preventing unauthorized access.

[0183] When the plugin is installed or first run, it reads whitelist information from a predefined file or user settings. The whitelist is typically a list of domain names, formatted like ["target-site.com", "another-site.com"]. The plugin then loads the whitelist into memory or internal storage for subsequent permission checks. The plugin also allows users to dynamically add new sites to the whitelist during subsequent operations. Whitelist updates can be made in the plugin's settings interface.

[0184] Before the plugin is ready to inject cookies into the target site, the permission control module will obtain the domain name information of the target site currently being requested. The domain name of the target site is used to determine whether the site is in the authorized whitelist, ensuring that cookie injection operations are performed only on authorized sites.

[0185] Before each cross-domain cookie injection operation, the plugin retrieves the domain name of the currently visited target site through the browser API. This domain name is typically obtained by parsing the currently active browser window or a specific URL. For example, if the target site is https: / / target-site.com, the plugin extracts the target-site.com portion as the target domain name.

[0186] The plugin uses the preset matching rules to compare the domain name of the target site with the entries in the permission whitelist. If the domain name of the target site is in the whitelist, it means that the site has been authorized to receive cross-domain cookies; if it does not match, authorization is denied.

[0187] The plugin checks each target site's domain name against the whitelist entries one by one using string matching or regular expressions. For example, if the whitelist contains target-site.com and the target site is https: / / sub.target-site.com, the plugin can use wildcard or regular expression matching to ensure that subdomains are also authorized.

[0188] If the target site's domain name matches the whitelist, the plugin confirms that the site is authorized to receive cross-domain shared cookies. The permission control module will allow subsequent cookie injection operations.

[0189] After confirming that the target site is authorized through matching rules, the plug-in sends an authorization signal through the permission control module, allowing the encrypted cookie to be injected into the target site. When the plug-in performs the cookie injection operation, it injects the encrypted cookie data into the target site through the browser's Cookie API, ensuring that the data is secure and only shared with authorized sites.

[0190] If the domain name of the target site does not match any entry in the whitelist, the permission control module will reject the cookie injection operation and record the unauthorized access attempt to the site to prevent sensitive data leakage.

[0191] If the plugin fails to match an authorized site, it will deny the cookie injection operation through the permission control module and record the unauthorized access log. The plugin can choose to inform the user that the site is not authorized through pop-ups, notifications, etc., or record the attempt in the background.

[0192] This embodiment implements a permission control mechanism, allowing the plug-in to ensure that only authorized target sites can receive cross-domain shared cookie information, preventing unauthorized sites from accessing sensitive data. This mechanism enhances the security of cross-domain sharing, ensuring that cookies are only passed between trusted sites, thereby improving data protection and privacy control capabilities.

[0193] In one embodiment, the above S70 includes:

[0194] S701, when it is confirmed that the target site has been authorized, setting the validity period of the encrypted Cookie information through the browser plug-in;

[0195] S702, calling the browser's Cookie management interface through the browser plug-in, and passing the encrypted Cookie information as a parameter to the Cookie management interface;

[0196] S703, injecting the encrypted cookie information into the target site through the cookie management interface;

[0197] S704: If the cookie injection is successful, record an injection success event, which includes the injection success timestamp, the target site domain name, and the cookie information.

[0198] S705: If the cookie injection fails, an injection failure event is recorded, where the injection failure event includes an injection failure timestamp and error information.

[0199] In this embodiment, after confirming that the target site is authorized, the plug-in needs to set an expiration date for the encrypted cookie information. The expiration date of the cookie determines how long it can be used on the target site. If the cookie expires, the target site will no longer accept the cookie information.

[0200] Before injecting cookies, the plugin sets an expiration date for each cookie, based on system requirements or user settings. This expiration date can be short-term (e.g., valid for the duration of a session) or long-term (e.g., one month). The plugin passes an expirationDate parameter through the browser's cookies.set() method, which represents the cookie's expiration date, expressed in Unix timestamp format. The plugin can dynamically adjust the cookie's expiration date based on the security policy of authorized sites, for example, setting a shorter expiration date for highly sensitive sites.

[0201] The plug-in calls the browser's Cookie management interface to actually perform the Cookie injection operation. The plug-in passes the previously encrypted Cookie information as a parameter to the interface to ensure that the Cookie information injected into the target site has been encrypted to prevent the data from being intercepted or tampered with during transmission. The plug-in passes parameters including domain, path, value (encrypted Cookie data), expirationDate, etc. through chrome.cookies.set() (in the Chrome browser) or the corresponding Cookie management API of other browsers. The encrypted Cookie data is generated by the previous encryption module to ensure that it is in ciphertext form and cannot be directly read during transmission. The plug-in ensures that when the Cookie is injected into the target site, it follows the specified domain, path and expiration date.

[0202] The plug-in successfully injects the encrypted cookie information into the target site through the cookie management interface provided by the browser. After receiving the cookie, the target site can use the encrypted information to complete identity authentication or session management.

[0203] The browser's cookie management interface injects the encrypted cookie information into the target site's storage. This process is similar to how a browser normally sets cookies, except that the data is encrypted by the plugin. The target site can then use these cookies in subsequent requests for authentication, session tracking, and other operations.

[0204] When the plugin successfully injects a cookie into the target site, it needs to record this event for subsequent auditing and debugging. The record includes the time of success, the target site domain name, and the injected cookie information (such as the cookie name and other metadata).

[0205] After each successful cookie injection, the plugin generates a success log, recording the injection operation timestamp, the target site's domain name, the injected cookie name, path, and expiration date. This log data can be stored in the plugin's internal logging system for subsequent query and problem tracking.

[0206] If the plugin fails to inject cookies, it must record the details of the failure to facilitate subsequent troubleshooting. The failure record should include the time the error occurred, the target site, and the specific error message.

[0207] Each time an injection fails, the plugin records the timestamp of the failure, the target site domain, and the error message that caused the failure. For example, the failure could be due to a permission issue, a network outage, or browser security restrictions. The plugin can record this information through a logging system or error reporting mechanism to help developers or administrators understand and resolve the issue.

[0208] This embodiment uses a browser plug-in to set the expiration date of encrypted cookie information and call the cookie management interface to inject the encrypted cookie into the target site. The plug-in records detailed logs of success and failure for each operation, facilitating subsequent review and troubleshooting. This process ensures the security and accuracy of cross-domain cookie sharing and prevents cookie abuse on the target site through expiration date management.

[0209] In one embodiment, a cross-domain cookie control device in a browser is provided, and the cross-domain cookie control device in the browser corresponds one-to-one to the cross-domain cookie control method in the browser in the above embodiment. Figure 3 , Figure 3 This is a functional module diagram of a preferred embodiment of the cross-domain cookie control device in a browser of the present invention. It includes a plug-in installation module 10, a configuration management module 20, a configuration parsing module 30, a cookie management module 40, an encryption module 50, a permission control module 60, and a cookie injection module 70. Each functional module is described in detail as follows:

[0210] A plug-in installation module 10 is used to install a pre-configured browser plug-in in the browser;

[0211] The configuration management module 20 is used to obtain a configuration file from the internal resources of the browser plug-in, wherein the configuration file includes preset source site domain name information and target site domain name information;

[0212] A configuration parsing module 30 is configured to parse the configuration file, extract the source site domain name information and the target site domain name information, and remove the protocol prefix in the source site domain name information and the target site domain name information;

[0213] The cookie management module 40 is used to call the cookie management interface of the browser through the browser plug-in to capture cookie information from the source site;

[0214] An encryption module 50 is used to encrypt the Cookie information through the browser plug-in;

[0215] The permission control module 60 is used to implement the permission control mechanism through the browser plug-in to determine whether the target site has been authorized;

[0216] The cookie injection module 70 is used to call the cookie management interface of the browser through the browser plug-in to inject the encrypted cookie information into the target site if the target site has been authorized.

[0217] In one embodiment, the plug-in installation module 10 is specifically configured to:

[0218] Setting up an installation wizard, wherein the installation wizard is used to guide the user to install the browser plug-in in the browser;

[0219] During the installation process, the browser plug-in is configured through a graphical user interface, and the configuration process includes inputting the domain name information of the source site and the domain name information of the target site;

[0220] Checking whether the source site domain name information and the target site domain name information comply with domain name naming standards;

[0221] If the source site domain name information and the target site domain name information do not conform to the domain name naming standard, a prompt is given to reconfigure valid domain name information;

[0222] The source site domain name information and the target site domain name information that comply with the naming standard are saved in the internal storage module of the browser plug-in, and the configuration file is generated.

[0223] In one embodiment, the parsing module 30 is configured to:

[0224] Parsing the domain name information in the configuration file using a regular expression through the browser plug-in to extract the source site domain name information and the target site domain name information;

[0225] Using a preset protocol prefix format, identifying whether the domain name strings of the source site domain name information and the target site domain name information have a protocol prefix;

[0226] If a protocol prefix is ​​identified, removing the protocol prefix from the source site domain name information and the target site domain name information;

[0227] Verify that the source site domain name information and the target site domain name information after removing the protocol prefix conform to the domain name format specification;

[0228] If the source site domain name information or the target site domain name information after removing the protocol prefix does not conform to the domain name format specification, an error message will be recorded and the user will be prompted to make corrections.

[0229] In one embodiment, the Cookie management module 40 is specifically configured to:

[0230] Configure a capture condition list, which is used to specify the URL pattern for capturing cookies from the source site;

[0231] Calling the cookie management interface of the browser through the browser plug-in, and passing the capture condition list as a parameter to the cookie management interface, for requesting the browser to filter and provide all cookies that meet the capture conditions according to the capture condition list;

[0232] Receiving the cookie list returned by the browser through the browser plug-in and filtering it according to predetermined rules;

[0233] Checking the attributes of each cookie, including the domain, path, and secure flag, to determine whether the cookie is suitable for cross-domain sharing;

[0234] For each cookie that passes the attribute check, verify that there is user consent or policy allowing the cookie to be shared across domains.

[0235] The authenticated cookie is stored in the memory or the internal storage module of the browser plug-in.

[0236] In one embodiment, the encryption module 50 is specifically configured to:

[0237] An encryption module is provided in the browser plug-in, wherein the encryption module is used to perform encryption processing of Cookie information;

[0238] Selecting a target encryption algorithm from a list of predefined encryption algorithms based on the browser's security requirements and the user's security preferences;

[0239] generating a random key using a random number generator through the encryption module, wherein the length and complexity of the random key match the target encryption algorithm;

[0240] Encrypting the Cookie information using the random key and the target encryption algorithm through the encryption module to generate encrypted Cookie data;

[0241] The encrypted Cookie data is stored in the internal storage module of the memory or the browser plug-in.

[0242] In one embodiment, the authority control module 60 is specifically configured to:

[0243] Setting an authority control module in the browser plug-in, wherein the authority control module is used to control and determine the authorization status of the site;

[0244] When the browser plug-in is installed or first run, the permission control module initializes a permission whitelist, wherein the permission whitelist contains domain names of sites that have been approved to receive cross-domain cookies;

[0245] Before each Cookie injection operation, the permission control module obtains the target site domain name information of the current request;

[0246] The permission control module uses a preset matching rule to match the target site domain name information with the entries in the permission whitelist to determine whether the target site has been authorized;

[0247] If the target site domain name information matches an entry in the permission whitelist, it is confirmed that the target site has been authorized, and the cookie injection is authorized through the permission control module;

[0248] If the target site domain name information does not match an entry in the permission whitelist, it is determined that the target site is not authorized, and the cookie injection is rejected through the permission control module.

[0249] In one embodiment, the Cookie injection module 70 is specifically configured to:

[0250] When it is confirmed that the target site has been authorized, setting the validity period of the encrypted Cookie information through the browser plug-in;

[0251] Calling the browser's Cookie management interface through the browser plug-in, and passing the encrypted Cookie information as a parameter to the Cookie management interface;

[0252] Injecting the encrypted cookie information into the target site through the cookie management interface;

[0253] If the cookie injection is successful, record the injection success event, which includes the injection success timestamp, target site domain name and cookie information;

[0254] If the cookie injection fails, an injection failure event is recorded, and the injection failure event includes an injection failure timestamp and error information.

[0255] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external user terminal via a network connection. When the computer program is executed by the processor, it realizes the functions or steps on the server side of a cross-domain cookie control method in a browser.

[0256] In one embodiment, a computer device is provided. The computer device may be a user terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, memory, network interface, display screen and input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it realizes the functions or steps on the user side of a cross-domain cookie control method in a browser.

[0257] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:

[0258] Install pre-configured browser plugins in your browser;

[0259] Obtaining a configuration file from the internal resources of the browser plug-in, wherein the configuration file includes preset source site domain name information and target site domain name information;

[0260] Parsing the configuration file, extracting the source site domain name information and the target site domain name information, and removing the protocol prefix in the source site domain name information and the target site domain name information;

[0261] The browser plug-in calls a cookie management interface of the browser to capture cookie information from a source site;

[0262] The browser plug-in encrypts the cookie information;

[0263] The browser plug-in implements an authority control mechanism to determine whether the target site has been authorized;

[0264] If the target site has been authorized, the browser plug-in calls the cookie management interface of the browser to inject the encrypted cookie information into the target site.

[0265] In one embodiment, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the following steps:

[0266] A pre-configured browser plug-in is installed in a browser;

[0267] A configuration file is obtained from internal resources of the browser plug-in. The configuration file contains preset source site domain name information and target site domain name information;

[0268] The configuration file is parsed to extract the source site domain name information and the target site domain name information, and the protocol prefix in the source site domain name information and the target site domain name information is removed;

[0269] The browser plug-in calls a cookie management interface of the browser to capture cookie information from a source site;

[0270] The browser plug-in encrypts the cookie information;

[0271] The browser plug-in implements an authority control mechanism to determine whether the target site has been authorized;

[0272] If the target site has been authorized, the browser plug-in calls the cookie management interface of the browser to inject the encrypted cookie information into the target site.

[0273] It should be noted that the functions or steps that the computer readable storage medium or the computer device can implement correspond to the related descriptions of the server side and the user side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0274] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0275] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0276] It should be noted that if any software tools or components other than those of the Company appear in the embodiments of this application, they are merely for illustration and do not represent actual use. The above embodiments are intended only to illustrate the technical solutions of the present invention, not to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some of the technical features therein with equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A cross-domain cookie control method in a browser, characterized in that: The following steps are involved: Install pre-configured browser plugins in your browser; Obtaining a configuration file from the internal resources of the browser plug-in, wherein the configuration file includes preset source site domain name information and target site domain name information; Parsing the configuration file, extracting the source site domain name information and the target site domain name information, and removing the protocol prefix in the source site domain name information and the target site domain name information; Configure a capture condition list, which is used to specify the URL pattern for capturing cookies from the source site; Calling the cookie management interface of the browser through the browser plug-in, and passing the capture condition list as a parameter to the cookie management interface, for requesting the browser to filter and provide all cookies that meet the capture conditions according to the capture condition list; Receiving the cookie list returned by the browser through the browser plug-in and filtering it according to predetermined rules; Checking the attributes of each cookie, including the domain, path, and secure flag, to determine whether the cookie is suitable for cross-domain sharing; For each cookie that passes the attribute check, verify that there is user consent or policy allowing the cookie to be shared across domains. Storing the verified cookie information in the memory or the internal storage module of the browser plug-in; Encrypting the Cookie information through the browser plug-in; Implementing a permission control mechanism through the browser plug-in to determine whether the target site has been authorized; If the target site has been authorized, the browser's Cookie management interface is called through the browser plug-in to inject the encrypted Cookie information into the target site.

2. The cross-domain cookie control method in a browser according to claim 1, wherein: Install pre-configured browser plugins in your browser, including: Setting up an installation wizard, wherein the installation wizard is used to guide the user to install the browser plug-in in the browser; During the installation process, the browser plug-in is configured through a graphical user interface, and the configuration process includes inputting the domain name information of the source site and the domain name information of the target site; Checking whether the source site domain name information and the target site domain name information comply with domain name naming standards; If the source site domain name information and the target site domain name information do not conform to the domain name naming standard, a prompt is given to reconfigure valid domain name information; The source site domain name information and the target site domain name information that comply with the naming standard are saved in the internal storage module of the browser plug-in, and the configuration file is generated.

3. The cross-domain cookie control method in a browser according to claim 1, wherein: Parsing the configuration file, extracting the source site domain name information and the target site domain name information, and removing the protocol prefix in the source site domain name information and the target site domain name information, including: Parsing the domain name information in the configuration file using a regular expression through the browser plug-in to extract the source site domain name information and the target site domain name information; Using a preset protocol prefix format, identifying whether the domain name strings of the source site domain name information and the target site domain name information have a protocol prefix; If a protocol prefix is ​​identified, removing the protocol prefix from the source site domain name information and the target site domain name information; Verify that the source site domain name information and the target site domain name information after removing the protocol prefix conform to the domain name format specification; If the source site domain name information or the target site domain name information after removing the protocol prefix does not conform to the domain name format specification, an error message will be recorded and the user will be prompted to make corrections.

4. The cross-domain cookie control method in a browser as described in claim 1, characterized in that: Encrypting the Cookie information through the browser plug-in includes: An encryption module is provided in the browser plug-in, wherein the encryption module is used to perform encryption processing of Cookie information; Selecting a target encryption algorithm from a list of predefined encryption algorithms based on the browser's security requirements and the user's security preferences; generating a random key using a random number generator through the encryption module, wherein the length and complexity of the random key match the target encryption algorithm; Encrypting the Cookie information using the random key and the target encryption algorithm through the encryption module to generate encrypted Cookie data; The encrypted Cookie data is stored in the internal storage module of the memory or the browser plug-in.

5. The cross-domain cookie control method in a browser according to claim 1, wherein: Implementing a permission control mechanism through the browser plug-in to determine whether the target site has been authorized includes: Setting an authority control module in the browser plug-in, wherein the authority control module is used to control and determine the authorization status of the site; When the browser plug-in is installed or first run, the permission control module initializes a permission whitelist, wherein the permission whitelist contains domain names of sites that have been approved to receive cross-domain cookies; Before each Cookie injection operation, the permission control module obtains the target site domain name information of the current request; The permission control module uses a preset matching rule to match the target site domain name information with the entries in the permission whitelist to determine whether the target site has been authorized; If the target site domain name information matches an entry in the permission whitelist, it is confirmed that the target site has been authorized, and the cookie injection is authorized through the permission control module; If the target site domain name information does not match an entry in the permission whitelist, it is determined that the target site is not authorized, and the cookie injection is rejected through the permission control module.

6. The cross-domain cookie control method in a browser according to claim 1, wherein: If the target site has been authorized, the browser's cookie management interface is called through the browser plug-in to inject the encrypted cookie information into the target site, including: When it is confirmed that the target site has been authorized, setting the validity period of the encrypted Cookie information through the browser plug-in; Calling the browser's Cookie management interface through the browser plug-in, and passing the encrypted Cookie information as a parameter to the Cookie management interface; Injecting the encrypted cookie information into the target site through the cookie management interface; If the cookie injection is successful, record the injection success event, which includes the injection success timestamp, target site domain name and cookie information; If the cookie injection fails, an injection failure event is recorded, and the injection failure event includes an injection failure timestamp and error information.

7. A cross-domain cookie control device in a browser, characterized in that: The cross-domain cookie control device in the browser includes: A plugin installation module, used to install pre-configured browser plugins in the browser; A configuration management module, configured to obtain a configuration file from the internal resources of the browser plug-in, wherein the configuration file includes preset source site domain name information and target site domain name information; A configuration parsing module is used to parse the configuration file, extract the source site domain name information and the target site domain name information, and remove the protocol prefix in the source site domain name information and the target site domain name information; A cookie management module is configured to configure a capture condition list, wherein the capture condition list is used to specify a URL pattern for capturing cookies from a source site; the cookie management interface of the browser is called through the browser plug-in, and the capture condition list is passed as a parameter to the cookie management interface, so as to request the browser to filter and provide all cookies that meet the capture conditions according to the capture condition list; the cookie list returned by the browser is received through the browser plug-in, and filtered according to predetermined rules; the attributes of each cookie are checked, wherein the attributes include domain, path, and security flag, to determine whether the cookie is suitable for cross-domain sharing; for each cookie that passes the attribute check, it is verified whether there is user consent or policy allowing the cookie to be shared across domains; and the verified cookie information is stored in a memory or an internal storage module of the browser plug-in; An encryption module, used to encrypt the Cookie information through the browser plug-in; The permission control module is used to implement the permission control mechanism through the browser plug-in to determine whether the target site has been authorized; The cookie injection module is used to call the cookie management interface of the browser through the browser plug-in if the target site has been authorized, and inject the encrypted cookie information into the target site.

8. A computer device, characterized in that: The computer device includes a memory, a processor, and a cross-domain cookie control program in a browser stored in the memory and running on the processor. When the cross-domain cookie control program in the browser is executed by the processor, the steps of the cross-domain cookie control method in the browser as described in any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that The storage medium stores a cross-domain cookie control program in a browser, and when the cross-domain cookie control program in the browser is executed by the processor, the steps of the cross-domain cookie control method in the browser as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Browser user identity verification system and method based on cross-domain resource access

    CN113806707A

  • Access verification system, method and device

    CN118573478A