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

By installing pre-configured plug-ins in the browser, automatically obtaining and parsing domain name information, capturing and encrypting cookie information, and implementing permission control, the complexity and security issues of cross-domain cookie management in the existing technology are solved, and efficient Secure cookie sharing.

CN119299161AActive Publication Date: 2025-01-10PING AN BANK CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing cross-domain cookie management technology relies on complex server-side configurations and lacks sufficient security protection during cookie transmission, resulting in low development efficiency and security risks.

Method used

By installing pre-configured browser plug-ins in the browser, domain name information can be automatically obtained and parsed, and cookie information can be captured by calling the browser's cookie management interface, and encryption processing and permission control can be carried out to ensure the security of cookies during cross-domain transmission. .

Benefits of technology

Simplified operation steps, avoid complex server-side configurations, improve the security and convenience of cookie sharing, reduce development and maintenance costs, and enhance user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299161A_ABST
    Figure CN119299161A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data security and the field of financial science and technology, and discloses a cross-domain Cookie control method in a browser, which comprises the following steps of: installing a pre-configured browser plug-in, acquiring a configuration file containing domain name information of a source site and a target site from internal resources of the plug-in, analyzing and extracting the domain name information, and removing a protocol prefix. And 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, implementing an authority control mechanism to judge whether the target site is authorized or not, and if the authorization is passed, injecting the encrypted Cookie information into the target site. According to the method and the device, the domain name information is automatically acquired and analyzed by installing the pre-configured browser plug-in, so that the operation steps are simplified, and complex server-side configuration is avoided. Through encryption processing and authority control, it is ensured that the Cookie information has high security in the cross-domain transmission process, data leakage and unauthorized access are effectively prevented, and security and convenience of cross-domain Cookie sharing are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of data security technology and financial technology, and in particular to a cross-domain cookie control method, device, equipment and storage medium in a browser. Background Art

[0002] In the system development in the financial field, developers often need to switch between service modules under multiple subdomains, such as product management, operation management, and approval processes. These modules may be deployed under different domains or subdomains, and the traditional cookie mechanism is limited by the browser's homology policy, which does not allow cross-domain sharing of cookie information. This causes developers to log in frequently 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 configuration and authentication mechanisms. For example, using Nginx proxy or reverse proxy to implement cookie sharing. Such solutions require major changes to the server side and involve complex configuration processes, which not only increases the difficulty of implementation and maintenance costs, but may also pose risks to the existing financial system architecture, especially when it comes to security and compliance issues.

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

[0005] Many existing solutions require users to perform manual configuration, such as specifying domain names, configuring cookie sharing rules, etc., which makes the entire process cumbersome and error-prone. For financial system developers, frequent manual operations not only reduce development efficiency, but also easily lead to data sharing failures or security risks due to improper configuration. Summary of the invention

[0006] The main purpose of the present invention is to provide a cross-domain Cookie control method, device, equipment and storage medium in a browser, aiming to solve the technical problems that the existing cross-domain Cookie management technology relies on complex server-side configuration and lacks sufficient security protection during Cookie transmission.

[0007] To achieve the above object, the present invention provides a cross-domain cookie control method in a browser, comprising:

[0008] Install pre-configured browser plugins in your 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 cookie management interface of the browser 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, 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;

[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, used 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 to inject the encrypted cookie information into the target site if the target site has been authorized.

[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 in the memory and executable on the processor, and the cross-domain cookie control program in the browser, when executed by the processor, implements the steps of the cross-domain cookie control method in the browser as described above.

[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 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, it is ensured that the cookie information has high security during cross-domain transmission, and effectively prevents data leakage and unauthorized access. Finally, 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 the browser of the present invention;

[0030] Figure 4 A schematic diagram of the structure of a computer device in one embodiment of the present invention;

[0031] Figure 5 FIG. 4 is another schematic diagram of the structure of a computer device in one 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 used 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 through a network. The server terminal can install a pre-configured browser plug-in through the user terminal, obtain a configuration file containing the domain name information of the source site and the target site from the internal resources of the plug-in, parse and extract the domain name information, remove the protocol prefix, call the browser's Cookie management interface through the plug-in to obtain the Cookie information of the source site, encrypt the Cookie information, implement the authority control mechanism to determine whether the target site is authorized, and if the authorization is passed, inject the encrypted Cookie information into the target site. The present invention automatically obtains and parses the 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 authority control, it is ensured that the Cookie information has high security during cross-domain transmission, and effectively prevents data leakage and unauthorized access. Finally, the security and convenience of cross-domain Cookie sharing are achieved, the user experience is improved, and the development and maintenance costs are reduced. Among them, the user terminal can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices. The server can be implemented with an independent server or a server cluster composed 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 means that the user integrates a plug-in with an initial configuration into the browser environment through the plug-in installation mechanism of the browser. The plug-in has been configured with internal parameters by the developer before installation, such as the domain name information of the source site and the target site, and the user does not need to manually set any complex server-side parameters. The installation process of the plug-in is usually completed through a few simple steps without the need for additional adjustments to the server.

[0038] A browser plug-in is a software component based on a browser extension framework (such as Chrome extension) that is designed to implement cross-domain management and sharing of cookies. The following describes in detail the implementation of the plug-in, including the design and implementation of each functional module, technology selection, data processing flow, and security measures. JavaScript is mainly used in combination with HTML and CSS for user interface construction. Chrome extension APIs (such as chrome.cookies, chrome.storage, etc.) are used for cookie management and data storage operations. 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: 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] The user selects and starts downloading the plug-in by visiting the browser's plug-in store or the download link provided by the enterprise. The browser will prompt the user to confirm the installation. After the user clicks to confirm, the plug-in will be automatically installed and displayed in the browser's extension plug-in list. After the plug-in is installed, the browser will automatically enable the plug-in and start the background services related to cookie sharing based on the pre-configured information. The plug-in manages the acquisition, encryption, injection and other operations of cookies through the background without further configuration by the user. The user can see the plug-in icon or setting interface on the browser interface and can check the running status of the plug-in, but does 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 plug-in in the browser, developers can avoid repeated login operations under each subdomain and ensure that identity authentication information is automatically shared between 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 operational 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 obtained from the internal resources of the browser plug-in, and the configuration file includes the domain name information of the preset source site and the target site. The configuration file is usually stored in JSON format and records which sites need to perform cookie sharing operations. By reading the configuration file from the internal resources of the plug-in, the plug-in can automatically obtain the required domain name information, avoiding manual input by the user, and ensuring the consistency and correctness 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 that contains two main fields: The source site domain name information (from) represents the site that 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 to memory and waits 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 the financial system, different modules (such as customer management system, loan approval system) are usually deployed under different subdomains. Developers can install pre-configured browser plug-ins, which will automatically obtain configuration files from internal resources, including the domain name information of the source site and the target site. 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, and developers do not need to enter it manually, ensuring the accuracy and efficiency of cross-site sharing operations.

[0055] By obtaining the configuration file from the internal resources of the plug-in, the plug-in realizes the automatic acquisition of the domain name information required for cross-site cookie sharing, avoiding manual input errors and complex operations. The plug-in can ensure the security and consistency of the configuration file, improve the user experience, and reduce the complexity of use.

[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 the domain name information is processed to remove unnecessary protocol prefixes (such as http: / / or https: / / ). This is to ensure that in subsequent cookie operations, only clean domain name strings are used without the protocol part. Extracting and processing domain name information can ensure the standardization of the domain name format, making subsequent operations more accurate and efficient.

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

[0059] After parsing the JSON file, the plugin extracts 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 and 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, leaving only the core part of the domain name (such as source-site.com). This operation can be achieved using the native URL parsing tool provided by the browser or by manually writing a regular expression 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 that the domain name format is standardized to avoid errors caused by inconsistent formats during cookie sharing.

[0062] Example description: In a financial system, developers need to switch between different modules, such as switching from https: / / cms.finance.com (customer management system) to https: / / las.finance.com (loan approval system). When the plug-in parses the configuration file, the domain names of the source and target sites may contain protocol prefixes. By removing these prefixes, the plug-in ensures that subsequent cookie sharing operations only use the core part of the domain name, 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, we ensure that standardized domain name information is used during cross-domain cookie sharing, avoiding format inconsistencies caused by the protocol prefix.

[0064] S40, calling the cookie management interface of the browser 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 cookie management interface provided by the browser. Cookies are small data files stored in the user's browser that are used to record the user's login status, session information, and preference settings. The browser's cookie management interface allows the plug-in to access and obtain cookie information under a specific domain name, thereby achieving cross-domain sharing and data transmission.

[0066] The browser provides a dedicated API interface for managing and operating cookies (for example, the chrome.cookies.getAll interface of the Chrome browser). The plug-in obtains the currently stored cookies from the source site by calling the API. When calling the API, the plug-in needs to pass the domain name of the source site as a parameter, and the API will return all cookie information related to the domain name.

[0067] When a plug-in accesses cookies, it must obtain the corresponding permissions granted by the user. When the browser installs the plug-in, it will ask the user to agree to cookie access permissions. Without user authorization, the plug-in cannot obtain or operate cookies. The plug-in ensures that it has access to the source site cookies through the permissions defined in the manifest.json file.

[0068] The plug-in can specify the acquisition conditions based on the domain name to ensure that only the cookie information related to the source site is obtained. For example, only the cookies under the current active window can be obtained, or the cookies under a specific path or subdomain can be obtained. In actual applications, the plug-in only needs to obtain cookies related to user authentication to ensure that users do not need to log in to other modules again after cross-domain sharing.

[0069] When the plug-in calls the API to obtain 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, security flag, etc. The plug-in will filter these cookie information, filter out irrelevant cookies, and ensure that only the required authentication cookies or session cookies are shared.

[0070] The captured cookie information will be 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 description: In the financial system, when a user logs in to https: / / cms.finance.com (customer management system), the browser will store the cookie of their authentication information. In order to log in seamlessly in https: / / las.finance.com (loan approval system), the plug-in installed by the developer will automatically capture the relevant authentication cookies from the source site (customer management system) through the browser's cookie management interface. This operation does not require manual intervention by the user. The plug-in will automatically obtain the cookie information of the login status to ensure that the user does not need to log in again when switching to the loan approval system, thereby improving the system's operating efficiency and user experience.

[0072] By calling the browser's Cookie management interface, the plug-in can automatically capture cookies related to user authentication information from the source site, avoiding the tedious operation of users manually exporting and importing cookies. This process ensures the efficient capture and accurate sharing of cookie information, provides a basis for subsequent cross-site sharing, and improves the user experience.

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

[0074] In this embodiment, the captured Cookie information is encrypted by the browser plug-in to ensure the security of data during cross-site transmission. The main purpose of encryption is to protect Cookie information and prevent it from being maliciously intercepted or tampered during transmission. The encryption algorithm ensures that Cookie information can only be decrypted and used at authorized sites.

[0075] When the plugin is installed or started for the first time, it will initialize an encryption module to handle the encryption of all sensitive data. This module is usually integrated into the background script of the plugin and uses a secure encryption algorithm to encrypt the data. The plugin can use asymmetric encryption (such as RSA algorithm) or symmetric encryption (such as AES algorithm) to ensure the security of the data. Asymmetric encryption can be used to ensure that only the target site can decrypt the data.

[0076] When the plugin performs encryption operations, it generates a random encryption key. The length and complexity of the key depends on the encryption algorithm used. For example, for AES encryption, 128-bit or 256-bit keys are usually used. Random keys can be created by the browser's secure random number generator, ensuring that the encryption key is highly secure and difficult to guess or crack by attackers.

[0077] The captured cookie information includes the cookie name, value, path, expiration time and other attributes. The plugin will encrypt this information, especially the cookie value (such as the user's authentication token or session information), because this part of the information is usually the most sensitive. The encryption operation will convert the cookie value from plain text to cipher text to ensure that it cannot be directly read or modified during transmission.

[0078] After encryption is complete, the plugin will store the encrypted cookie information in memory, ready to be transmitted to the target site. These encrypted data can be temporarily saved in the plugin's internal storage, waiting for the target site's request. Through the plugin's control, the encrypted cookies can only be accessed by authorized sites, ensuring that they will not be obtained by unauthorized third parties.

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

[0080] Example: In the financial system, after the user logs in to https: / / cms.finance.com (customer management system), the system generates cookie information for user authentication. These cookies contain the user's identity token or session ID. In order to share this information in https: / / las.finance.com (loan approval system), the plug-in captures these cookies and encrypts them. By using the RSA encryption algorithm, the cookie information is securely encrypted, and only the loan approval system can decrypt and read this information, thereby ensuring the security and integrity of the user's identity information. This encryption process is crucial in the financial field, and can prevent user sensitive information from being obtained or tampered with by malicious attackers during cross-site transmission.

[0081] By encrypting the captured cookie information, the plug-in greatly improves the security of data during transmission and prevents the cookie information from being intercepted or tampered with by a third party. This encryption operation ensures that only authorized sites can read and decrypt cookie information, greatly 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. The function of this module is to manage and determine whether the target site has the permission to receive cookies. A permission whitelist list is maintained inside the plugin, which contains the domain name information of all authorized sites. Each time a cross-domain cookie sharing operation is performed, this module will be called to check whether the target site is in the whitelist.

[0085] Before cross-domain cookie sharing, the plugin will obtain the domain name information of the current target site. This is usually obtained by passing the domain name parameter of the target site when calling the browser's cookie setting interface. The domain name information can be directly extracted from the plugin configuration file (such as defined in domain.json) or obtained through dynamic settings entered by the user.

[0086] The plug-in matches the target site domain name of the current request with the pre-set permission whitelist through the permission control module. The whitelist stores a list of all sites that are authorized to receive cookie information. If the domain name of the target site matches an entry in the whitelist, it means that the site has been authorized and is allowed to perform cookie sharing operations.

[0087] If the target site is not in the whitelist, the plugin will block the cookie sharing operation. At this time, the plugin can issue a warning or log record to the user, indicating that the site is not authorized and rejecting cookie injection. The plugin can also selectively 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, the administrator updates the list of authorized sites through the internal enterprise system, or adjusts the authorization scope in real time according to user operations. Each time the plug-in is started, it will check and update the permission whitelist to ensure that the latest authorization rules are in effect and prevent unauthorized access caused by old authorization rules.

[0089] The plugin records the results of each permission check, whether authorized or unauthorized. The log information includes the timestamp, the target site domain name, and the permission check result. This helps to trace the history of permission checks during later troubleshooting or security audits.

[0090] Example description: In a financial system, users may need to switch between system modules under multiple subdomains, such as switching from https: / / cms.finance.com (customer management system) to https: / / las.finance.com (loan approval system). Through the plug-in's permission control mechanism, the domain name of the loan approval system is in the whitelist, so it can safely receive the user's authentication cookie information. If the user attempts to share cookie information in an unauthorized third-party site https: / / external-site.com, the plug-in will automatically reject the operation to protect the user's sensitive data from being leaked. This mechanism ensures that sharing between modules within the financial system is secure and will not be leaked to external unauthorized sites.

[0091] By implementing a permission control mechanism, the plug-in ensures that only authorized target sites can receive and use shared cookie information. This mechanism effectively prevents unauthorized sites from obtaining sensitive data, enhancing system security and data privacy protection. When processing cross-domain cookie sharing, the plug-in can automatically perform permission checks, reducing user manual operations and improving system automation and security.

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

[0093] In this embodiment, when the target site passes the permission check and obtains authorization, the browser plug-in will inject 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 then use these cookies for identity authentication or session management. This step ensures data security and prevents unauthorized sites from obtaining cookie information.

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

[0095] The plug-in calls the browser's cookies.set() interface to inject the encrypted cookie information into the target site. This interface can set the target site's domain name, cookie name, encrypted value, validity period, path, and other information. The plug-in sends these encrypted cookies to the target site based on the configuration file or dynamically set parameters so that the site can use these cookies for user authentication.

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

[0097] The plugin can set an expiration date for each injected cookie, ensuring that the cookie is valid only within a specified time frame. If the target site requires a long session, the plugin can set a longer expiration date; otherwise, the default setting is a short session. The plugin can also automatically expire based on security requirements, so that the relevant session cookies can be automatically deleted after the user leaves the target site, improving security.

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

[0099] Example description: In the financial system, when a user successfully logs in from https: / / cms.finance.com (customer management system), the plug-in automatically captures and encrypts the user's identity authentication cookie. When the user visits https: / / las.finance.com (loan approval system), the plug-in first checks whether the site is in the authorization whitelist. After confirming the authorization, the plug-in injects the encrypted user authentication cookie into the loan approval system through the browser's cookie management interface, and the user does not need to log in again. This operation ensures the security authentication and seamless connection between sub-modules within the financial system, improves the user experience, and ensures the security of sensitive information during transmission.

[0100] Through the authorization mechanism, only authorized target sites can receive encrypted cookie information and use this information for authentication or session management. The encryption processing and injection mechanism effectively improves the security of data transmission and prevents unauthorized sites from accessing sensitive user information. At the same time, the plug-in's automatic injection and logging functions improve 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 the 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, it is ensured that the cookie information has high security during the cross-domain transmission process, and effectively prevents data leakage and unauthorized access. Finally, 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 conform to the domain name naming standard;

[0106] S104, if the source site domain name information and the target site domain name information do not meet 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 meet 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 process of installing the plug-in for the user, and to allow the user to easily complete the installation of the plug-in through step-by-step operation instructions. The wizard usually appears in the form of a graphical user interface (GUI) to guide the user to complete the necessary configuration operations, such as entering the site domain name information, agreeing to the plug-in permissions, etc. Through the installation wizard, the user can avoid complex manual settings and ensure the correct installation and configuration of the plug-in.

[0109] The plug-in installation package comes with an installation wizard. When users visit the browser plug-in store or download the plug-in through the internal enterprise system, the installation wizard will automatically start. The installation wizard prompts users to perform necessary operations step by step through a friendly graphical interface, including selecting the installation path and agreeing to permission requests (such as accessing cookies, reading and writing internal storage, etc.). During the installation process, users do not need to manually modify any files or codes, and the wizard will automatically manage all steps.

[0110] During the plugin installation process, users enter the domain name information of the source and target sites through the graphical user interface (GUI). This configuration step is intended to provide the plugin with the domain name information required for cross-site cookie sharing to ensure correct cookie transmission between sites. Users fill in the domain name information through a simple input box, avoiding the tedious process of manually modifying the configuration file.

[0111] The installation wizard provides an input box to prompt the user to fill in the domain name information of the source site and the target site, such as https: / / cms.finance.com and https: / / las.finance.com. The plug-in interface will display a concise prompt message to guide the user to enter the domain name in the correct format. When the user completes the input, the plug-in will temporarily store this information and prepare for the next step of domain name format verification.

[0112] After the user enters the domain name information, the plug-in will automatically check whether the entered domain name conforms to the standard domain name format. Domain name naming standards usually require that the domain name structure conforms to the regular format (such as suffixes such as .com, .org, etc.), and the domain name does not contain illegal characters. This step is to ensure that the entered domain name is legal, which will help with subsequent cross-site cookie sharing operations.

[0113] The plug-in has a built-in domain name verification function, which detects the source and target site domain names entered by the user through regular expressions or the browser's native URL parsing tool. The verification logic includes: whether the domain name contains illegal characters, whether it lacks a top-level domain (such as .com, .net), and whether it contains a protocol prefix that does not conform to the specification (such as a misspelled http: / / ). After the verification is passed, the plug-in continues to the next step; if the verification fails, the user is prompted to make corrections.

[0114] If the domain name entered by the user does not meet the domain name standard, 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, which will cause subsequent cookie sharing operations to fail.

[0115] When the plug-in detects that the domain name format is illegal, it will prompt the user to correct it through a pop-up window, red warning text, or highlight the incorrectly entered domain name. The prompt information contains a help document link or format example to guide the user to enter the correct domain name information. The user can re-enter the legal domain name according to the prompt until the verification is passed.

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

[0117] The plug-in saves the verified domain name information to internal storage, usually the browser plug-in's localStorage or a similar storage mechanism. The plug-in generates a configuration file (such as domain.json), which records the source and target site domain name information entered by the user in JSON format. After the configuration file is generated, the plug-in will automatically call the file during operation to ensure that the correct domain name information is used during cross-site cookie sharing operations.

[0118] This embodiment provides an installation wizard and a graphical user interface, and the plug-in simplifies the process of users configuring the domain names of the source site and the target site, avoiding the complicated manual configuration file editing operation. The domain name format verification function ensures that users enter legal 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 the security of operations and user experience.

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

[0120] S301, 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;

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

[0122] S303, if a protocol prefix is ​​identified, removing 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 site and the target site. The configuration file is usually in JSON format and stores the domain name information of the source site and the target site. Regular expressions quickly locate and extract domain names by matching specific formats of strings (such as letters, numbers, and special symbols in the domain name).

[0126] The plugin reads the internally stored configuration file (such as domain.json), which contains the full URLs of the source and target sites. Use regular expressions to extract the domain name part, for example, match the URL format of https: / / source-site.com, and extract the source-site.com part as the source site domain name. Use similar operations to extract the domain name information of the target site.

[0127] Check if the extracted domain name contains the preset protocol prefixes (such as http: / / or https: / / ). The protocol prefix indicates the protocol of network communication (HTTP or HTTPS), but in the process of 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 plug-in uses a regular expression to check whether the domain name string contains the http: / / or https: / / prefix. If a protocol prefix is ​​detected, it marks the prefix as a removable part and prepares for the next step of processing.

[0129] When the plug-in detects the presence of 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 of 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 the 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 does not conform to the standard format after removing the protocol prefix, the plug-in will record an error message and prompt the user through a pop-up window or prompt box 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 legal domain name to prevent errors in subsequent operations.

[0134] The plug-in records the detected error information (such as illegal domain name format) in the log so that developers or users can troubleshoot the problem. The plug-in prompts the user through the graphical user interface (GUI) that the domain name does not meet the requirements and guides the user to re-enter the correct domain name information. After the user enters the correct domain name, the plug-in performs domain name verification again until the format meets the specifications.

[0135] Example: In the financial system, different modules are usually deployed under multiple subdomains, such as the customer management system (https: / / cms.finance.com) and the loan approval system (https: / / las.finance.com). The plug-in 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 name), the plug-in will prompt the user to correct it to ensure smooth cross-domain operations and reduce errors.

[0136] This embodiment uses regular expressions to parse the domain name information in the configuration file and removes the protocol prefix to ensure that a clean domain name format is used in cross-site operations, thereby improving the accuracy of the operation. At the same time, through the domain name format verification and user prompt function, cross-domain failures caused by incorrect input are prevented, thereby improving the reliability of the operation 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 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;

[0140] S403, receiving the Cookie list returned by the browser through the browser plug-in, and filtering according to a predetermined rule;

[0141] S404, checking 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 the source site cookie, which is used to specify the URLs from which the cookie is captured. These conditions can be set according to information such as domain name, path, protocol, etc., to ensure that the plug-in only obtains cookies that meet the conditions and avoids obtaining irrelevant cookie data.

[0145] When the plugin is started, it defines a list of capture conditions, including the domain name, path and possible protocol (http or https) of the source site. For example, the capture condition can be limited to https: / / source-site.com / *, ensuring that only cookies from all paths of source-site.com are captured. These conditions can be adjusted according to the actual needs of the user, for example, only login-related cookies can be captured, while ignoring other unimportant 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 interface and passes the previously defined capture condition list as parameters. For example, the plugin can pass parameters as: {domain:'source-site.com',path:' / ',secure:true}. The browser filters all eligible cookies under the current domain based on these parameters and returns these cookies to the plugin for subsequent processing. This process ensures that only cookies related to the source site are captured, and cookie information under other domain names is not mistakenly captured.

[0148] After receiving a list of eligible cookies from the browser, the plug-in filters these cookies according to preset rules. The preset rules can include information such as the validity period, purpose, and path of the cookie. Through filtering, the plug-in can further narrow the scope of cookies and only retain the cookies that need to be shared.

[0149] The cookie list returned by the browser contains multiple cookie objects, each of which includes the cookie's name, value, path, domain name, expiration time and other attributes. The plug-in filters unnecessary cookies according to the predetermined filtering rules (such as only retaining cookies with unexpired validity periods or cookies under a specified path). For example, only cookies under the path / login can be retained. 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 checks the properties of each cookie one by one, focusing on the domain (to determine whether it belongs to the source site), path (to determine the scope of the cookie), and security flags (such as Secure or HttpOnly). If a cookie is found to have the HttpOnly flag, the plugin will not share the cookie, because this flag indicates that the cookie can only be used through the HTTP protocol and cannot be read through JavaScript. After the property check, only cookies that meet the cross-domain sharing conditions will enter the next step of processing.

[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 plugin checks whether the user has agreed to cross-domain sharing of cookies through the browser's privacy settings. For example, if the user has enabled the "Block third-party cookies" option in the browser, the plugin will not share these cookies. The plugin 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 will not be shared. After user consent or policy verification, eligible cookies are marked as shareable.

[0154] Verified cookies 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 are 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] In this embodiment, by configuring the capture condition list and using the browser's cookie management interface, the plug-in can accurately capture the cookies of the source site, and filter and check the attributes according to the predetermined rules to ensure that only cookies that meet the cross-domain sharing conditions are processed. This mechanism improves the security and accuracy of cross-site sharing, while avoiding unnecessary cookie transmission and 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 security requirements of the browser and the security preference settings of the user;

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

[0160] S504, encrypting the Cookie information by 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 set inside the plug-in, which is specifically used to process the encryption operation of Cookie information. The main function of the encryption module is to convert the captured sensitive data (such as Cookie) into ciphertext through an encryption algorithm to ensure that the data will not be obtained by unauthorized third parties during transmission or storage. The encryption module is integrated into the plug-in to automatically handle all encryption tasks without manual intervention by the user.

[0163] When the plug-in is initialized, it will load and activate the encryption module, which is usually implemented using a JavaScript encryption library (such as CryptoJS or Web CryptoAPI). The encryption module is combined with the browser's security mechanism to ensure that the captured cookie data is encrypted before it is stored or transmitted.

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

[0165] The plug-in predefines a set of secure encryption algorithms, including AES (symmetric encryption) and RSA (asymmetric encryption). The plug-in can automatically select the encryption algorithm that best suits the current scenario based on user settings or browser security configuration (such as whether high security mode is enabled). For example, if you need to encrypt a large amount of data quickly, you may choose AES, while if you need higher security and the amount of data is not large, you may choose RSA.

[0166] The key used in the encryption process is generated by a random number generator, and the length and complexity of the key match the selected encryption algorithm. The random key is an important part of ensuring data security during the encryption process, and the strength of the key directly determines the security of the encrypted data.

[0167] The plugin generates random keys using the browser's built-in secure random number generator (such as window.crypto.getRandomValues), ensuring that the generated keys are highly unpredictable and secure. The length of the generated key depends on the selected encryption algorithm. For example, AES encryption may require a 128-bit or 256-bit key, and 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 uses the previously generated random key and the target encryption algorithm to encrypt the captured cookie information. The encrypted cookie information will be stored and transmitted in ciphertext to ensure that the data cannot be read or modified by unauthorized entities during transmission.

[0169] After obtaining the cookie information, the plug-in will call the selected encryption algorithm (such as AES or RSA) through the encryption module and encrypt the cookie using the generated random key. For example, for AES encryption, the plug-in will encrypt each cookie value and convert the plaintext cookie value into ciphertext. The ciphertext can only be restored to its original value when the decryption key exists. The encrypted cookie information will be converted into an unreadable ciphertext form to ensure 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 to ensure that the data is available in the current session. If these cookies need to be saved for a long time, the plugin can store the encrypted data in localStorage or other plugin internal storage to ensure that the data is still accessible after the browser is closed. The encrypted data in memory is cleaned up regularly to prevent performance degradation due to excessive data.

[0172] This embodiment sets an encryption module in the browser plug-in, and the plug-in can securely encrypt the captured cookie information to ensure that the data cannot be accessed by unauthorized entities during transmission and storage. Selecting a suitable encryption algorithm and generating a highly secure random key further improves the security and anti-cracking ability of the data. The encrypted data is stored in the memory or internal storage of the plug-in, ensuring the security of cross-site cookie sharing.

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

[0174] S601, setting a permission control module in the browser plug-in, wherein the permission 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 the 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, confirm that the target site has been authorized, and authorize cookie injection 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 confirmed that the target site is not authorized, and Cookie injection is rejected through the permission control module.

[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 to ensure that only authorized sites can receive shared Cookie information.

[0181] The plugin will load the permission control module when it is initialized. The module is responsible for storing and managing the authorization status of the target site. The permission control module can dynamically update the authorization status, allowing the authorization information of the site to be added or removed during subsequent runs. The plugin can use the permission control module to limit which sites can receive cookies based on business needs.

[0182] When the plug-in is installed or run for the first time, it will initialize a permission whitelist through the permission control module. The whitelist contains the authorized site domain names. These sites have been approved by the system or user and can receive cross-domain shared cookies. The role of the whitelist is to pre-screen the target sites that can share cookies to avoid unauthorized site access.

[0183] When the plugin is installed or first run, the plugin reads the whitelist information from a predefined file or user settings. The whitelist is usually a list of domain names in a format similar to ["target-site.com", "another-site.com"]. The plugin loads the whitelist into memory or internal storage for subsequent permission determination. The plugin can also allow users to dynamically add new sites to the whitelist in subsequent operations. The whitelist can be updated in the plugin 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 requested. The domain name of the target site is used to determine whether the site is in the authorized whitelist, ensuring that the cookie injection operation is performed only on authorized sites.

[0185] Before each cross-domain cookie injection operation, the plug-in obtains the domain name of the currently visited target site through the browser API. This domain name is usually obtained by parsing the current active window of the browser or a specific URL. For example, if the target site is https: / / target-site.com, the plug-in will extract the target-site.com part as the target domain name.

[0186] The plug-in 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 the domain name of the target site one by one through string matching or regular expressions to see if it matches the entries in the whitelist. For example, if the whitelist contains target-site.com and the target site is https: / / sub.target-site.com, the plugin can match it through wildcards or regular expressions to ensure that the subdomain is also authorized.

[0188] If the domain name of the target site matches the whitelist, the plug-in 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 will inject the encrypted cookie data into the target site through the browser's Cookie API to ensure data security and only share it on 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] When the plug-in fails to match an authorized site, it will reject the cookie injection operation through the permission control module and record the unauthorized access log. The plug-in 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, and the plug-in ensures 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 transmitted 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 Cookie management interface of the browser 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 the injection success event, the injection success event includes the injection success timestamp, the target site domain name and Cookie information;

[0198] S705: If the Cookie injection fails, record an injection failure event, 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 plug-in will set an expiration date for each cookie information according to system requirements or user settings. The expiration date can be short-term (such as valid during a session) or long-term (such as 1 month). The plug-in passes an expirationDate parameter through the browser's cookies.set() interface, which indicates the expiration date of the cookie in Unix timestamp format. The plug-in can dynamically adjust the validity period of the cookie according to the security policy of the authorized site. For example, a shorter validity period can be set 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 the target site receives the cookie, it 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 the normal behavior of setting cookies in the browser, except that the data is encrypted through the plug-in. The target site can 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, the plugin 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 timestamp of the injection operation, the domain name of the target site, the name, path and validity period of the injected cookie, etc. These log data can be stored in the plugin's internal log system for subsequent query and problem tracking.

[0206] If the plugin fails when performing a cookie injection operation, the plugin needs to record detailed information about the failure to facilitate subsequent troubleshooting. The failure record should include the time the error occurred, the target site, and specific error information.

[0207] Each time an injection fails, the plugin records the timestamp of the failure, the target site domain name, and the error message that caused the failure. For example, the failure may 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 so that developers or administrators can understand and resolve the problem.

[0208] This embodiment sets the validity period of the encrypted cookie information through the browser plug-in and calls the cookie management interface to inject the encrypted cookie into the target site. The plug-in records a detailed log of success or failure in each operation to facilitate subsequent review and troubleshooting. This process ensures the security and accuracy of cross-domain cookie sharing, and at the same time prevents the abuse of cookies on the target site through validity period 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 the browser of the present invention. Plug-in installation module 10, configuration management module 20, configuration parsing module 30, cookie management module 40, encryption module 50, permission control module 60 and cookie injection module 70. The detailed description of each functional module is as follows:

[0210] A plug-in installation module 10, 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 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;

[0213] Cookie management module 40, 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, 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 used to:

[0218] Setting 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 source site domain name information and target site domain name information;

[0220] Check 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 meet 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 meet 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 configuration parsing module 30 is specifically 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 character string of the source site domain name information and the target site domain name information has 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 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;

[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 is recorded and the user is prompted to make corrections.

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

[0230] Configure a capture condition list, the capture condition list 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 that allows 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 used for:

[0237] An encryption module is set in the browser plug-in, and 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 security requirements of the browser and the security preferences of the user;

[0239] Generate 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] The encryption module uses the random key and the target encryption algorithm to encrypt the Cookie information 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 used to:

[0243] A permission control module is set in the browser plug-in, and the permission 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 whitelist is initialized through the permission control module, and the permission whitelist contains the 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 confirmed that the target site is not authorized, and Cookie injection is rejected through the permission control module.

[0249] In one embodiment, the Cookie injection module 70 is specifically used 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. 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 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 through a network connection. When the computer program is executed by the processor, it implements the functions or steps of a cross-domain cookie control method server side 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, a memory, a network interface, a display screen and an 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 the 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 implements 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, wherein the processor implements the following steps when executing the computer program:

[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] Invoke the cookie management interface of the browser through the browser plug-in to capture cookie information from the source site;

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

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

[0264] 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.

[0265] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

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

[0267] 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;

[0268] 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;

[0269] Invoke the cookie management interface of the browser through the browser plug-in to capture cookie information from the source site;

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

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

[0272] 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.

[0273] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the user side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.

[0274] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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. As an illustration and not limitation, RAM is available in many 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 can clearly understand that for the convenience and simplicity 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 software tools or components other than those of the Company appear in the embodiments of the present application, they are only used for illustration and do not represent actual use. The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the above-mentioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents; and 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 protection scope 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; Invoke the cookie management interface of the browser through the browser plug-in to capture cookie information from the source site; 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, characterized in that: Install pre-configured browser plugins in your browser, including: Setting 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 source site domain name information and target site domain name information; Check 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 meet 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 meet 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, characterized in that: 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 character string of the source site domain name information and the target site domain name information has 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 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; 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.

4. The cross-domain cookie control method in a browser according to claim 1, characterized in that: The browser plug-in calls the cookie management interface of the browser to capture cookie information from the source site, including: Configure a capture condition list, the capture condition list 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 that allows the cookie to be shared across domains; The authenticated Cookie is stored in the memory or the internal storage module of the browser plug-in.

5. The cross-domain cookie control method in a browser as described in claim 1, characterized in that: The cookie information is encrypted by the browser plug-in, including: An encryption module is set in the browser plug-in, and 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 security requirements of the browser and the security preferences of the user; Generate 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; The encryption module uses the random key and the target encryption algorithm to encrypt the Cookie information to generate encrypted Cookie data; The encrypted Cookie data is stored in the internal storage module of the memory or the browser plug-in.

6. The cross-domain cookie control method in a browser according to claim 1, characterized in that: Implementing a permission control mechanism through the browser plug-in to determine whether the target site has been authorized includes: A permission control module is set in the browser plug-in, and the permission 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 whitelist is initialized through the permission control module, and the permission whitelist contains the 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 confirmed that the target site is not authorized, and Cookie injection is rejected through the permission control module.

7. The cross-domain cookie control method in a browser according to claim 1, characterized in that: If the target site has been authorized, the browser plug-in calls the browser's Cookie management interface 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.

8. 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, 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; 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, used to call the cookie management interface of the browser through the browser plug-in to capture cookie information from the source site; 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 to inject the encrypted cookie information into the target site if the target site has been authorized.

9. 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 executable 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 7 are implemented.

10. 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-7 are implemented.

Citation Information

Patent Citations

  • Cross-site login method, cross-site login system and a cross-site login device

    CN103634329A

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

    CN113806707A

  • Access verification system, method and device

    CN118573478A

  • System and Method for the Creation, Management, and Delivery of Personal Cookie-Like Packets of Information to be Utilized as Reverse Cookies within Network-Based Environments

    US20200084285A1