Methods and systems for maintaining web login status

By determining the client address and the number of historical login attempts based on token data within the single sign-on system, recommending login methods and generating access tokens, the problem of forced logins caused by user errors is resolved, providing a login experience that better suits user preferences.

CN117155606BActive Publication Date: 2026-11-179513 COM
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310964921.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-02
Publication Date
2026-11-17
Estimated Expiration
2043-08-02

AI Technical Summary

Technical Problem

In a single sign-on system, users may be forced to log in to a subsite they do not want to use due to accidental operation, causing inconvenience and affecting user experience.

Method used

By analyzing the client's address information and token data, the system parses historical login attempts, recommends login methods, generates an access token, and transmits it via postMessage to prevent forced logins caused by accidental operations.

Benefits of technology

When users visit a target subsite for the first time, the system proactively prompts them whether they want to continue, providing a login method that better aligns with their subjective preferences and avoiding forced logins due to accidental operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117155606B_ABST
    Figure CN117155606B_ABST
Patent Text Reader

Abstract

This application relates to a method and system for maintaining a web page login status. The method, before accessing a target subsite, pre-determines whether the client at the current address has already accessed a subsite under the same domain. If a subsite has already been accessed, it analyzes the historical login count associated with the address information in the token data based on the client's address information and token data. It then determines whether this is the first time accessing the target subsite and recommends a login method accordingly. This ensures that when accessing the target subsite for the first time from the current address, the user is prompted whether to continue accessing, instead of directly sending an access token to the subsite. If it is not the first time accessing the target subsite, silent login continues. This approach proactively prompts the user upon first access, preventing forced login to unwanted subsites due to accidental operations and providing a web page login method that better aligns with the user's subjective preferences.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method and system for maintaining a web page login status. Background Technology

[0002] As the business continues to grow, more and more systems are being created. If each system has an independent user authentication and authorization mechanism, it will not only increase the workload and development cost of system development and maintenance, but also prevent multiple systems from accessing each other, resulting in a poor user experience and hindering collaborative work between different business systems.

[0003] Currently, the traditional solution is to use SSO (Single Sign-On), where each subsite under the same domain connects to a unified SSO system. User authentication and authorization are managed by the SSO system. Each subsite under the same domain sends user information and request session to the SSO system to confirm whether the user has the necessary access or operation permissions. This allows the login status to be recorded after a single login, so that when requesting access to multiple different subsites under the same domain, there is no need to request login again.

[0004] However, in some application scenarios, after logging into subsite A, a user may accidentally visit subsite B for the first time. If the user does not wish to use subsite B under the current IP address or does not wish to register for subsite B, they must manually log out or cancel their account. This forced login via single sign-on thus causes inconvenience for the user. Summary of the Invention

[0005] Therefore, it is necessary to provide a method and system for maintaining web login status to address the inconvenience caused to users by forced login in some application scenarios.

[0006] This application provides a method for maintaining a web page login status, including:

[0007] In response to a client's access request to the target subsite, query the client's address information and token data;

[0008] Based on the client's address information, determine whether the login page is already logged in;

[0009] If the login page is already logged in, then further determine whether the client has accessed a subsite under the same domain.

[0010] If the client has already accessed a subsite under the same domain, then based on the client's address information and token data, the historical login count associated with the address information in the token data is parsed, and a login method is recommended based on the historical login count;

[0011] Update the login status on the login page, and generate an access token from the login page and transmit it to the target subsite via postMessage;

[0012] Log in and access the target subsite based on the access token.

[0013] This application also provides a system for maintaining a web page login status, including:

[0014] The client is used to provide a visual page for user interaction;

[0015] The server includes a memory and a processor, the processor being configured to execute an executable computer program stored in the memory to implement the web page login state maintenance method as described above.

[0016] This application relates to a method and system for maintaining a web page login status. The method, before accessing a target subsite, pre-determines whether the client at the current address has already accessed a subsite under the same domain. If a subsite has already been accessed, it analyzes the historical login count associated with the address information in the token data based on the client's address information and token data. It then determines whether this is the first time accessing the target subsite and recommends a login method accordingly. This ensures that when accessing the target subsite for the first time from the current address, the user is prompted whether to continue accessing, instead of directly sending an access token to the subsite. If it is not the first time accessing the target subsite, silent login continues. This approach proactively prompts the user upon first access, preventing forced login to unwanted subsites due to accidental operations and providing a web page login method that better aligns with the user's subjective preferences. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating a method for maintaining a webpage login status according to an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0019] This application provides a method for maintaining web login status. It should be noted that the method for maintaining web login status provided in this application can be applied to any business type, such as internal enterprise applications, cloud applications, and federated authentication.

[0020] like Figure 1 As shown, in one embodiment of this application, the method for maintaining the webpage login status includes the following steps S100 to S610.

[0021] S100 responds to the client's access request to the target subsite by querying the client's address information and token data.

[0022] Specifically, the address information can be a MAC address or an IP address, and it is unique. The token data is obtained by the server from the client's cookie and can be empty or non-empty. When the user has not performed any historical access operations on the client, the token data obtained by the server is empty. When the user has visited a subsite under the same domain on the client, the client's cookie will store account information (such as username and password), and the token data obtained by the server will be non-empty.

[0023] S200 determines whether the login page is already logged in based on the client's address information.

[0024] S310 If the login page is already logged in, then further determine whether the client has accessed a subsite under the same domain.

[0025] Specifically, for example, if www.example.com is the main site, then different business websites app1.example.com and app2.example.com are subsites under the same domain.

[0026] S400: If the client has already accessed a subsite under the same domain, then based on the client's address information and token data, the historical login count associated with the address information in the token data is parsed, and a login method is recommended based on the historical login count.

[0027] Specifically, historical login counts are linked to address information, including login counts for different sub-sites within the same domain that are linked to the address information. If the current login count for a sub-site within the same domain linked to the address information is 0, it indicates this is the first visit.

[0028] Login methods include silent login and prompting for continued access.

[0029] S500 updates the login status on the login page and generates an access token (access_token) which is then transmitted to the target subsite via postMessage.

[0030] Specifically, updating the login status on the login page includes, but is not limited to, methods such as cookies and session storage.

[0031] S610, Log in to the target subsite based on the access token.

[0032] In this embodiment, before accessing the target subsite, it is determined in advance whether the client at the current address has already accessed a subsite under the same domain. If a subsite has already been accessed, the historical login count associated with the address information in the token data is parsed based on the client's address information and token data. The historical login count is used to determine whether this is the first time accessing the target subsite, and a login method is recommended accordingly. This ensures that when accessing the target subsite for the first time from the current address, the user is prompted whether to continue accessing, instead of directly sending an access token to the subsite. If it is not the first time accessing the target subsite, silent login continues. This approach proactively prompts the user upon first access, avoiding forced login to unwanted subsites due to accidental operations, and providing a web login method that better aligns with the user's subjective preferences.

[0033] In one embodiment of this application, after S200, the method for maintaining the web page login status further includes the following S321 to S322.

[0034] S321, If ​​the login page is not in a logged-in state, the login module is called through the login page.

[0035] Specifically, the login module can be implemented as a login pop-up or by redirecting to a login window.

[0036] S322, based on the login account information entered in the login module, after successful verification, the login status of the login page is updated, and an access token is generated by the login page and transmitted to the target sub-site via postMessage.

[0037] Specifically, users enter their username and password on the login page displayed on the client to verify their login. Once the user successfully logs in, an access token (access_token) is generated for the user. The login page then redirects to subsite A with the access token.

[0038] In this embodiment, when a user logs into all subsites under the same domain for the first time through the client (i.e., no operations have been performed on any subsites under this domain under the current client address), or when the login status of the login page expires, the user needs to access the site using their login account information.

[0039] In one embodiment of this application, S400 includes the following S410 to S431.

[0040] S410, parse the historical login count of the target subsite associated with the address information in the token data.

[0041] S420, determine whether the target subsite associated with the address information is being visited for the first time.

[0042] Specifically, a first visit is defined as a visit when the historical login count of the target subsite associated with the address information is 0. A non-first visit is defined as a visit when the historical login count of the target subsite associated with the address information is greater than 1.

[0043] S431, if the target subsite associated with the address information is being accessed for the first time, the login module is called through the login page for the user to verify login.

[0044] In this embodiment, the number of historical logins to the target subsite is used to determine whether the client at the current address is accessing the target subsite for the first time. During the first access, a prompt is provided to avoid forced login to an unwanted subsite due to accidental operation.

[0045] In one embodiment of this application, S400 includes the following S432.

[0046] S432, if the target subsite associated with the address information is not being accessed for the first time, then S500 is executed. For example, if a user successfully logs into subsite A and then logs into subsite B within the validity period of the login page, and subsite B is not being accessed for the first time, subsite B will not redirect the user to the login page again to re-enter their username, password, or other login account information; instead, the user will directly access the site successfully.

[0047] In this embodiment, if the login page is already logged in and the target subsite associated with the address information is not being visited for the first time, the user can directly access the target subsite without having to jump to the login page again, and the login operation is imperceptible to the user.

[0048] In some application scenarios, clients from different addresses may log in to the same account at the same time, and the same account can only log in under one address. In this case, it is necessary to take into account the priority of the address and then respond to the current client's access request accordingly to prevent access to the target subsite from higher priority addresses from being automatically and forcibly logged out.

[0049] In one embodiment of this application, before S610, the method for maintaining the web page login status further includes the following S601 to S604.

[0050] S601, determine whether the target subsite has been logged in with the same account on a client with a different address.

[0051] S602, if the target subsite has already been logged in with the same account on a client with a different address, then determine whether the current client's historical login count is less than the historical login count of the client with a different address.

[0052] Specifically, the priority of addresses is determined by the number of historical logins, and addresses with a higher number of historical logins are considered the user's frequently used addresses and have higher priority.

[0053] S603: If the current client's historical login count is less than the historical login count of clients with different addresses, then the priority login confirmation module is called through the login page.

[0054] Specifically, the priority login confirmation module can be presented in the form of a pop-up or a jump window, allowing users to actively click to confirm.

[0055] S604: If the current client's historical login count is greater than or equal to the historical login count of a client with a different address, then directly access the target subsite.

[0056] In this embodiment, the priority of an address is determined by the number of historical logins associated with the client address. In the case of multiple logins, different access methods are adopted according to the different address priorities to avoid automatic forced logout of access to the target subsite by higher priority addresses.

[0057] In one embodiment of this application, the access token has a duration, and the login status duration of the login page is automatically updated when an access token is issued to any subsite.

[0058] For example, the duration can be set to 2 weeks, and if you visit again within 2 weeks, you can automatically log in to any sub-site under the same domain as the main site.

[0059] In this embodiment, by setting a duration, access requests within the duration do not require the user to request a login token again using account verification, which is convenient for users.

[0060] In one embodiment of this application, the method for setting the duration includes:

[0061] 1) Parse account permissions and the number of historical logins associated with the address information based on the client's address information and token data.

[0062] Specifically, historical login counts reflect how frequently a user accesses a client address. Based on historical login counts, addresses can be categorized into frequently used addresses and infrequently used addresses, with each type having a different impact on the duration of the connection.

[0063] Account permissions can be categorized based on user roles or account levels. For example, in a live streaming app, permissions can be divided into streamer permissions, visitor permissions, and administrator permissions. Furthermore, different durations can be set for different account permissions.

[0064] 2) Set the duration based on account permissions and the number of historical logins associated with the address information.

[0065] In this embodiment, the retention period is set by comprehensively considering the historical login count associated with account permissions and address information, so that the retention period can meet the needs of different users.

[0066] Access tokens typically have an expiration date. After expiration, the system will silently (without the user's awareness) verify the user's identity on the login page. If the user remains logged in, a new temporary token will be silently issued to the subsite. In some scenarios, a user may simultaneously access multiple subsites within the same domain on their client, some of which may be inactive (e.g., the subsite is open in a browser but the user is not interacting with it). If the expiration date of access tokens for all subsites is monitored and a new token is silently issued upon expiration, it will increase the server load.

[0067] In one embodiment of this application, the method for maintaining the web page login status further includes the following steps S710 to S750.

[0068] S710 filters active subsites from all same-domain subsites that maintain access status based on priority.

[0069] S720: Iterate through all active subsites and determine whether the time of the most recent acquisition of the access token is greater than the preset validity period.

[0070] S730: If the time of the most recent acquisition of the access token is greater than the preset validity period, then the active sub-site whose most recent acquisition of the access token is greater than the preset validity period is marked as an expired sub-site.

[0071] S740 further determines whether the login page is in a logged-in state.

[0072] S750: If the login page is in a logged-in state, an access token is generated and sent to the expired subsite.

[0073] In this embodiment, by filtering active sub-sites according to priority and only monitoring the validity period of access tokens for active sub-sites, the computational pressure on the server is reduced.

[0074] In one embodiment of this application, S710 includes the following S711a to S713a.

[0075] S711a, determine whether the number of same-domain subsites that are kept in access status is greater than 1.

[0076] S712a, if the number of same-domain subsites that remain in access status is greater than 1, then sort the same-domain subsites by login time to obtain a sorting table.

[0077] Specifically, the sorting rule for the sorting table is: the subsite whose login time is closest to the current time is ranked higher in the sorting table. Furthermore, after obtaining a new access token, the login time is updated to the time when the access token was obtained again.

[0078] S713a: Select a preset number of sub-sites in the sorting table as active sub-sites.

[0079] Specifically, based on the sorting rules of the sequence list, several (e.g., 3) of the top-ranked sub-sites in the same domain are selected as active sub-sites.

[0080] In this embodiment, login time is used as the sorting criterion to filter out potentially active subsites, and the filtering method is simple and easy to implement.

[0081] In one embodiment of this application, S710 includes the following S711b to S712b.

[0082] S711b, determine whether the number of same-domain subsites that are kept in access status is greater than 1.

[0083] S712b: If the number of same-domain subsites that are in access status is greater than 1, then the currently active same-domain subsite is selected as the active subsite.

[0084] Specifically, if a user clicks on a subsite within a preset time period, the subsite will be marked as active.

[0085] In this embodiment, the activity status of sub-sites within the same domain is used as a criterion for filtering active sub-sites, which can accurately reflect the degree of attention paid to several sub-sites within the same domain.

[0086] This application also discloses a system for maintaining web page login status.

[0087] The system for maintaining the login status of the webpage includes a client and a server.

[0088] Specifically, the client is used to provide a visual page for user interaction. The server includes a memory and a processor, the processor being used to execute an executable computer program stored in the memory to implement the web page login state maintenance method as described above.

[0089] The technical features of the above embodiments can be combined arbitrarily, and the execution order of the method steps is not restricted. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0090] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for maintaining a webpage login status, characterized in that, The method for maintaining the webpage login status includes: In response to a client's access request to the target subsite, query the client's address information and token data; Based on the client's address information, determine whether the login page is already logged in; If the login page is already logged in, then further determine whether the client has accessed a subsite under the same domain. If the client has already accessed a subsite under the same domain, then based on the client's address information and token data, the historical login count associated with the address information in the token data is parsed, and a login method is recommended based on the historical login count; Among them, the historical login count of the target subsite associated with the address information in the parsed token data; Determine whether the target subsite associated with the address information is being accessed for the first time; if it is, call the login module through the login page for the user to verify login. Update the login status on the login page, generate an access token from the login page, and transmit it to the target subsite via postMessage; log in and access the target subsite based on the access token; Active sub-sites are selected from all sub-sites in the same domain that maintain access status based on priority; all active sub-sites are traversed, and it is determined whether the time of the most recent acquisition of the access token is greater than the preset validity period; If the time since the last access token was obtained is greater than the preset validity period, then the active subsite whose last access token was obtained is greater than the preset validity period will be marked as an expired subsite. Further determine whether the login page is in a logged-in state; if the login page is in a logged-in state, generate an access token and send it to the expired subsite.

2. The method for maintaining webpage login status according to claim 1, characterized in that, After determining whether the login page is already logged in based on the client's address information, the method for maintaining the webpage login status further includes: If the login page is not in a logged-in state, the login module will be called through the login page; Based on the login account information entered in the login module, after successful verification, the login status of the login page is updated, and an access token is generated by the login page and transmitted to the target subsite via postMessage.

3. The method for maintaining webpage login status according to claim 1, characterized in that, Before logging into the target subsite based on the access token, the method for maintaining the webpage login status further includes: Determine if the target subsite has already been logged into by the same account on a client with a different address; If the target subsite has already been logged in with the same account on a client with a different address, then determine whether the current client's historical login count is less than the historical login count of the client with a different address; If the current client's historical login count is less than that of clients with different addresses, the priority login confirmation module will be invoked through the login page.

4. The method for maintaining webpage login status according to claim 1, characterized in that, The access token has a validity period, and the login status validity period on the login page is automatically updated when an access token is issued to any subsite.

5. The method for maintaining webpage login status according to claim 4, characterized in that, The method for setting the duration includes: parsing account permissions and historical login counts associated with the address information based on the client's address information and token data; and setting the duration based on the account permissions and historical login counts associated with the address information.

6. The method for maintaining webpage login status according to claim 1, characterized in that, The process of selecting active subsites from all remaining accessible subsites within the same domain based on priority includes: Determine if the number of same-domain subsites that are still in access status is greater than 1; If the number of subsites in the same domain that remain accessible is greater than 1, then the subsites in the same domain are sorted by login time to obtain a sorting table; Select a preset number of sub-sites in the same domain as active sub-sites from the sorting table.

7. The method for maintaining webpage login status according to claim 1, characterized in that, The process of selecting active subsites from all remaining accessible subsites within the same domain based on priority includes: Determine if the number of same-domain subsites that are still in access status is greater than 1; If the number of same-domain subsites that remain in access status is greater than 1, then the currently active same-domain subsite will be designated as the active subsite.

8. A system for maintaining a webpage login status, characterized in that, Includes: a client-side application, used to provide visual pages for user interaction; The server includes a memory and a processor, the processor being configured to execute an executable computer program stored in the memory to implement the method for maintaining a web page login state as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Login verification method and device, storage medium and server

    CN109802941A

  • Method for realizing unified login of plurality of existing web systems

    CN111343189A

  • Multi-device simultaneous login management method and system, electronic device and storage medium

    CN115186249A