CN113966590B - Site session termination method, device, terminal equipment and medium - Google Patents
Site session termination method, device, terminal equipment and medium Download PDFInfo
- Publication number
- CN113966590B CN113966590B CN201980097493.6A CN201980097493A CN113966590B CN 113966590 B CN113966590 B CN 113966590B CN 201980097493 A CN201980097493 A CN 201980097493A CN 113966590 B CN113966590 B CN 113966590B
- Authority
- CN
- China
- Prior art keywords
- page
- user
- parameter
- cache
- identity
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The application provides a method, a device, a terminal device and a medium for terminating a site session, which are applicable to the technical field of data processing, and the method comprises the following steps: when a user successfully logs in a first access site through a first tag page, acquiring an identity of the user which is stored in a cache of a user terminal and corresponds to the first access site, and copying the identity to a first user parameter field in a SessionStorage corresponding to the first tag page; if the operation event of the first tab page is page refreshing, clearing the identity identifier in the cache, and copying the first user parameter to an identity identifier field in the cache when the page is reloaded on the first tab page; and if the operation event on the first label page is a closed page, clearing the identity identifier and the first user parameter in the cache so as to terminate the session between the user terminal and the first access site. According to the embodiment of the application, when the user closes the tab page, the session between the user terminal and the website is effectively controlled to be immediately terminated.
Description
Technical Field
The present application belongs to the technical field of data processing, and in particular, to a method, an apparatus, a terminal device, and a medium for terminating a site session.
Background
When a user successfully logs in the site through the label page, the site returns an identity of the user, the identity is stored in a cookie and other caches by the user terminal, and is sent to the site together with the identity when a request is sent to the site each time, so that identity authentication and data interaction of the site are realized.
For some special scenes, for example, some systems with higher security requirements may need to terminate sessions between the user terminal and the website immediately when the user closes the tab page (if multiple tab pages all access the same website, the sessions need to be terminated immediately when all tab pages accessing the website are closed), in order to implement that the sessions between the user terminal and the website are terminated immediately when the user closes the tab page, in the prior art, a browser bearer event (the bearer event corresponds to a closed tab page or a refresh) is monitored, when the bearer event is monitored, the user terminal sends a user logout request to the website, so that the website executes a user logout operation to end the sessions, and if the bearer event corresponds to a refresh, the browser reloads the tab pages, and at this time, the user terminal sends a logout cancellation request to the server again to cancel the user logout operation. Although this method can terminate the session with the site when the user closes the tab page, it requires the cooperation of the front and back ends of the user terminal and the site server, which is complicated in logic and inefficient in execution.
Therefore, the prior art has difficulty in effectively controlling the session of the user terminal and the site to be immediately terminated when the user closes the tab page.
Disclosure of Invention
In view of this, embodiments of the present application provide a site session termination method and terminal device, so as to solve the problem that it is difficult in the prior art to effectively control a session between a user terminal and a site to be immediately terminated when a user closes a tab page.
A first aspect of an embodiment of the present application provides a site session termination method, including:
when a user successfully logs in a first access site through a first tag page, acquiring an identity of the user, which is stored in a cache of a user terminal and corresponds to the first access site, and copying the identity to a first user parameter field in a SessionStorage corresponding to the first tag page;
monitoring the operation event of the user on the first tab page;
if the operation event of the first label page is page refreshing, clearing the identity in the cache, and copying the first user parameter to an identity field in the cache when the first label page reloads the page;
and if the operation event of the first tab page is a closed page, clearing the identity identifier and the first user parameter in the cache so as to terminate the session between the user terminal and the first access site.
A second aspect of an embodiment of the present application provides a site session termination apparatus, including:
the system comprises an information backup module, a first access site and a second access site, wherein the information backup module is used for acquiring an identity of a user stored in a cache of a user terminal and corresponding to the first access site when the user successfully logs in the first access site through a first tag page, and copying the identity to a first user parameter field in a SessionStorage corresponding to the first tag page;
the first event monitoring module is used for monitoring the operation event of the user on the first tab page;
a first information migration module, configured to clear the identity identifier in the cache if the operation event on the first tab page is a page refresh event, and copy the first user parameter to the identity identifier field in the cache when the page is reloaded on the first tab page;
and the first information clearing module is used for clearing the identity identifier and the first user parameter in the cache if the operation event on the first tab page is a closed page, so that the session between the user terminal and the first access site is terminated.
A third aspect of the embodiments of the present application provides a terminal device, where the terminal device includes a memory and a processor, where the memory stores a computer program that is executable on the processor, and the processor implements the steps of the station session termination method when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, comprising: there is stored a computer program, characterized in that the computer program realizes the steps of the site session termination method as described above when executed by a processor.
Compared with the prior art, the embodiment of the application has the beneficial effects that: in the browser, sessionStorage can only temporarily store the related data of a single tab page, and the stored data can be deleted along with the closing of the tab page. In the embodiment of the application, the identity in the cache is backed up into the SessionStorage of the tag page, the identity in the cache is cleared as long as an operation event occurs, and when the operation is to refresh the page, that is, when the user does not close the tag page, the identity in the SessionStorage is copied back into the cache when the page is reloaded, so that the identity of the user cannot be lost, the site session access can be continued normally, and when the tag page is closed, the identity in the SessionStorage is deleted together, so that all the identities in the user terminal are cleared, the user terminal cannot perform session with the site any more, and therefore, a session immediate termination effect that the back-end code is not relied on, the server is not required to cooperate and interact, the logic is simpler and has higher execution efficiency is achieved, and when the tag page is closed by the user, the session of the user terminal and the site is effectively controlled to be terminated immediately.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments or the prior art description will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings may be obtained according to these drawings without inventive labor.
Fig. 1 is a schematic flowchart illustrating an implementation flow of a site session termination method according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation process of a site session termination method according to a second embodiment of the present application;
fig. 3 is a schematic flow chart illustrating an implementation process of a site session termination method according to a third embodiment of the present application;
fig. 4 is a schematic flowchart illustrating an implementation flow of a site session termination method according to a fourth embodiment of the present application;
fig. 5 is a schematic flowchart illustrating an implementation flow of a site session termination method according to a fifth embodiment of the present application;
fig. 6 is a schematic structural diagram of a station session termination apparatus according to a sixth embodiment of the present application;
fig. 7 is a schematic diagram of a terminal device provided in the seventh embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to explain the technical means described in the present application, the following description will be given by way of specific examples.
In order to facilitate understanding of the present application, first, briefly introducing an embodiment of the present application, for a Storage event, a browser has two offline Storage modes, namely a SessionStorage and a LocalStorage, where the SessionStorage can only temporarily store related data of a single tab page, and can delete the stored data with the closing of the tab page, and the LocalStorage can simultaneously store related data of all tab pages accessing the same site, and cannot delete the stored data with the closing of the tab page or the closing of the browser. In order to immediately terminate the session when the tag page is closed, the embodiment of the application backs up the identity to the SessionStorage of the tag page, the identity in the original cache can still be continuously used when the user normally accesses the site, when the user refreshes or closes the tag page, the embodiment of the application directly deletes the identity in the cache, and performs the identity processing of the backup in the SessionStorage according to the actual operation event, if the page is refreshed, the embodiment of the application copies the identity backed up in the SessionStorage back to the cache to ensure the subsequent normal site access of the user, and if the page is closed, the embodiment of the application directly clears the identity in the SessionStorage together, so that as long as the user closes the tag page, all the identities in the user terminal are cleared, the user terminal cannot perform the session with the site any more, thereby realizing that the session is immediately terminated without depending on a backend code, without the cooperation of a server, and the session logic is simpler to execute higher efficiency, and realizing that the session is effectively controlled to immediately terminate the session with the tag page when the user closes the user. The details are as follows:
fig. 1 shows a flowchart of an implementation of a site session termination method according to an embodiment of the present application, which is detailed as follows:
s101, when a user successfully logs in a first access site through a first label page, acquiring an identity of the user stored in a user terminal cache and corresponding to the first access site, and copying the identity to a first user parameter field in a Sessionstorage corresponding to the first label page.
The first tab page is not particularly limited to a certain tab page, and may be a tab page on which any user successfully logs in a site. If the browser includes a plurality of first tab pages, for each first tab page, the method in the embodiment of the present application is used to monitor, and when the tab page is closed, the session with the corresponding site is terminated.
When a user successfully logs in a certain website in a label page, the website returns an identity of the user for subsequent session authentication, and the identity can be a random character string or a character string generated according to a certain rule and specifically needs to be determined according to actual application conditions. For the received id, the embodiment of the present application stores it in a local cache of the user terminal, where the specific cache location can be set by a technician according to actual needs, including but not limited to cookie, for example. It should be noted that, because the user may log in a plurality of different sites through different tab pages at the same time, that is, a plurality of identifiers corresponding to the plurality of different sites may be stored in the cache at the same time, in this embodiment of the present application, only the identifier returned by the site logged in corresponding to the first tab page that needs to be monitored is read.
In the embodiment of the application, a user parameter with null field data is preset in the SessionStorage of the tag page, and after the required identity is read, the identity data is backed up into the field of the user parameter of the SessionStorage of the tag page, so that the identity is backed up and stored in the SessionStorage.
S102, monitoring the operation event of the user on the first tab page.
In the embodiment of the present application, the monitored operation events mainly include a refresh page and a close page, where the specific monitoring method is not limited herein and can be set by a technician according to a requirement, including but not limited to monitoring the operation events by monitoring browser before unload events.
S103, if the operation event of the first label page is page refreshing, the identity in the cache is cleared, and when the page is reloaded on the first label page, the first user parameter is copied to the identity field in the cache.
When the operation event is to refresh the tag page, it indicates that the user only wants to refresh the webpage instead of terminating the session, and at this time, in the embodiment of the present application, the identity data in the cache is cleared first, and the identity in the SessionStorage is copied back to the cache again when the page is refreshed, so as to ensure that the subsequent user can normally read the identity from the cache, and ensure the subsequent normal session with the site.
And S104, if the operation event on the first label page is a closed page, clearing the identity identifier and the first user parameter in the cache so as to terminate the session between the user terminal and the first access site.
When the operation event is closing the tag page, the embodiment of the application can directly empty the cache and the identity identification data in the SessionStorage, so that the local storage does not have the effective identity identification of the access site, and the session between the user terminal and the site is immediately terminated.
In the embodiment of the application, by using the sessionStorage backup identity, the tab page can be emptied when closed, the tab page can not continue to survive for a certain time after being closed (even the browser is completely closed), and the sessionStorage has no intermediate state, so that the session is immediately terminated.
As an embodiment of the present application, considering that in practical applications, a user may visit the same site in multiple tab pages, and all tab pages visiting the same site directly use a user id in a cache to perform a data interaction session with the site, at this time, if each tab page is processed according to the method in the embodiment of the present application only, then all remaining tab pages will have no usable id as long as one tab page is closed, so that the session is terminated by mistake, and in order to prevent this, as shown in fig. 2, the method includes:
s201, monitoring a second access site corresponding to the second label page.
In the embodiment of the present application, the second tab page refers to a tab page that is opened after the first tab page successfully logs in the site.
S202, if the second access site is the same as the first access site, detecting whether a second user parameter field in the second tab Session storage is empty.
When the sites accessed by the two label pages are the same, the identity required by the label pages in the site conversation is also consistent, and at the moment, the second label page can directly read the identity corresponding to the site stored in the cache in the site conversation. However, in the first embodiment of the present application, since the identity in the cache may be cleared, and when the first tab page is closed, the identity of the cache after clearing may not be recovered yet, at this time, a situation that the second tab page cannot normally talk with the site due to the fact that the first tab page is closed may occur very likely, and therefore, in the user parameter of the SessionStorage of the second tab page, whether the identity data is backed up may be detected in the embodiment of the present application, so as to provide a basis for subsequent independent backup and recovery of the identity.
S203, if the second user parameter field is empty, copying the first user parameter to the second user parameter field.
If the data of the user parameter field for the identity backup in the second tab page is null, it indicates that the second tab page has not been subjected to the identity backup of the SessionStorage, and at this time, the embodiment of the present application will share and backup the identity in the SessionStorage in the first tab page across the tab pages into the SessionStorage in the second tab page. In the first embodiment of the present application, since the identity identifier in the cache may be cleared, that is, may not exist in real time, if a manner of backing up the identity identifier in the cache to the second tabbed page SessionStorage is adopted, it is very likely that the backup cannot be completed, and therefore the embodiment of the present application performs cross-tabbed backup on the identity identifier in the first tabbed page SessionStorage. The identity sharing method between SessionStorage is not limited herein, and can be set by a technician, including but not limited to the method as in the third embodiment of the present application.
And S204, if the second user parameter field is not empty, copying the second user parameter to the identity identification field in the cache.
In practical applications, if the first tab page is closed, the cache is directly caused to have no corresponding identity, so that the user cannot normally converse with the site through the second tab page, and therefore, when the identity is backed up in the SessionStorage of the second tab page, the second tab page is backed up into the cache (if the same identity is already in the cache, the second tab page can be selectively covered or not copied), so that the corresponding identity can be provided in the cache as long as one tab page is not closed, and normal conversation with the site is ensured.
S205, monitoring the operation event of the user on the second tab page.
And S206, if the operation event on the second label page is to refresh the page, clearing the identity in the cache, and copying the second user parameter to the identity field in the cache when the page is reloaded on the second label page.
And S207, if the operation event on the second label page is a closed page, clearing the identity identifier and the second user parameter in the cache.
The principle of S205 to S207 is the same as that of S102 to S204 in the first embodiment of the present application, and only the operation is changed from the first tab page to the second tab page, so that specific reference may be made to the related description in the first embodiment of the present application, and details are not repeated herein.
In the second embodiment of the present application, for a situation that the same site is accessed in multiple tab pages, the identity identifiers are respectively backed up in different tab pages SessionStorage, because the backed-up data does not change with the subsequent change of the backup source, and only deleted with the closing of the corresponding tab page by the user, and as long as there is an identity identifier in the SessionStorage in one tab page, the identity identifier is copied into the cache, so that the remaining tab pages that are not closed can be normally conversed with the site, and when all the tab pages that access the same site are closed, because the SessionStorage data of all the tab pages and the identity identifiers in the corresponding caches are all emptied, the user terminal does not have an effective identity identifier, and thus the session is immediately terminated.
As a third embodiment of the present application, since SessionStorage cannot directly share data therebetween, in order to implement the sharing of the identity across SessionStorage in the second embodiment of the present application, the embodiment of the present application performs data transfer based on LocalStorage, as shown in fig. 3, the method includes:
s301, if the second user parameter is null, modifying the state parameter in the LocalStorage corresponding to the first label page and the second label page together.
S302, when the state parameter changes, copying the first user parameter to a transfer parameter field in LocalStorage.
And S303, when the transfer parameter is changed and the second user parameter field is empty, copying the changed transfer parameter to the second user parameter field and emptying the transfer parameter.
For a first tab page and a second tab page which access the same site, the first tab page and the second tab page have a shared LocalStorage, in order to realize the sharing of the identity identifiers in both SessionsStorage, in the embodiment of the application, a state parameter and a transfer parameter are set in the LocalStorage, wherein the state parameter is suitable for informing whether the sharing of the identity identifiers of the SessionsStorage needs to be carried out, and the transfer parameter is used for data transfer when the identity identifiers of the SessionsStorage are shared, specifically;
when the user parameter in the SessionStorage of the second tab page is empty, that is, there is no backup identity, the embodiment of the present application first modifies the content of the state parameter in the LocalStorage, so that the state parameter changes, and sets a monitoring mechanism for the state parameter, if the state parameter changes, the identity data in the SessionStorage of the first tab page is copied to the transfer parameter in the LocalStorage, and meanwhile, sets a monitoring mechanism for the transfer parameter, and when the transfer parameter changes, it is detected whether there is a backup identity in the SessionStorage of the second tab page, and if not, it indicates that the identity backup is needed, so that the embodiment of the present application copies the changed transfer parameter data to the user parameter in the SessionStorage of the second tab page, so as to implement the cross-tab-page SessionStorage backup of the identity. Meanwhile, after the backup is completed, the data in the parameters can be transferred, so that a basis is provided for subsequent operations such as other data transfer. In the embodiment of the present application, the specific value of the state parameter may be some specific data, such as a real-time value for executing S301, or may be only a simple state tag, such as 0 and 1, and only needs to ensure that the data content before and after each modification is different.
In the fourth embodiment of the present application, considering that the operation on the tab page may also be a page jump, and when the target site of the jump is not the original visited site, the target site is also a type of leaving site, and for some occasions with high security requirements, if it is required that a certain site is visited without the tab page, the session with the original site needs to be terminated immediately after the jump to another site, so as shown in fig. 4, the method includes:
and S105, if the operation event of the first label page is page jump and the target site of the jump is different from the first access site, clearing the identity and the first user parameter in the cache.
In the embodiment of the application, if a page jump operation is detected in the tag page, and a target station of the jump is different from an access station which is successfully logged in originally, that is, the target station needs to leave the original access station, the identity marks in the cache and the SessionStorage are directly cleared, so that the real-time session termination is realized.
In the fifth embodiment of the present application, considering that the operation on the tab page may also be a page jump, and when the target site to be jumped is not the original visited site, it is also a type of leaving site, and in some occasions with high security requirements, if it is required that a certain site is visited without the tab page, the session with the original site needs to be terminated immediately after the tab page is jumped to another site, so on the basis of the first to third embodiments of the present application, in the case where a plurality of tab pages access the same site at the same time, as shown in fig. 5, the method includes:
and S208, if the operation event for the second label page is page jump and the target site of the jump is different from the second access site, clearing the identity and the second user parameter in the cache.
When a plurality of tab pages are accessed to the same site, the embodiment of the application respectively monitors page jump of each tab page, and clears the cache and the identity in the SessionStorage when the tab page jumps away from the original accessed site.
It should be particularly noted that, in the first to fifth embodiments of the present application, the second tab page that is the same as the first tab page for accessing the site is not characterized by one or several tab pages, but all tab pages that are subsequently opened continuously for accessing the same site on the basis that the first tab page realizes successful login to the site, in practical applications, the number of the second tab pages and the time for creating each second tab page are unpredictable and need to be determined according to actual user usage, and what is required to be realized in the first to fifth embodiments of the present application is that after all the tab pages (i.e. the set of the first tab page and the second tab page) for accessing the same site are closed, the session between the user terminal and the site is terminated immediately, and before that, as long as all the tab pages are not closed, the session between the user terminal and the site should be normally reserved, that is, it is required to ensure that the identification data corresponding to the available site is left in the cache.
One prior art technique for addressing the immediate termination of a session after closing a tab page: and directly storing the identity in the SessionsStorage of each tag page, and extracting the identity from the SessionsStorage for authentication when a conversation is carried out on the site.
Since the SessionStorage cannot share data, and the data in the LocalStorage cannot be deleted along with the closing of the label page, in the prior art, if the identity is directly stored in the SessionStorage, a user is required to perform login operation once when opening a new label page, the operation is very complicated and inconvenient, if the identity is directly stored in the LocalStorage, the identity cannot be deleted in time when the label page is closed, and the session cannot expire normally.
Therefore, in the first to fifth embodiments of the present application, the mechanism for storing the identity identifier in the original cache does not need to be modified, and the identity identifier only needs to be backed up by the SessionStorage on the basis of the original mechanism, and the corresponding operations such as clearing and transferring the identity identifier data are performed under different operating conditions, so that the user does not need to perform repeated login operation in each tab page, and when all tab pages accessing the same site are closed, the session between the user terminal and the site is immediately ended, the logic is simple, the execution efficiency is high, and excessive modification of the existing mechanism is not needed.
Fig. 6 shows a block diagram of a site session termination apparatus provided in the embodiment of the present application, which corresponds to the method in the above embodiment, and only shows portions related to the embodiment of the present application for convenience of description. The site session termination apparatus illustrated in fig. 6 may be an execution subject of the site session termination method provided in the first embodiment.
Referring to fig. 6, the site session termination apparatus includes:
the information backup module 61 is configured to, when a user successfully logs in a first access site through a first tab page, obtain an identity of the user, which is stored in a cache of a user terminal and corresponds to the first access site, and copy the identity to a first user parameter field in a SessionStorage corresponding to the first tab page.
A first event monitoring module 62, configured to monitor an operation event of the first tab page by the user.
A first information migration module 63, configured to clear the identity in the cache if the operation event on the first tab page is a page refresh event, and copy the first user parameter to the identity field in the cache when the page is reloaded on the first tab page.
A first information clearing module 64, configured to clear the identity identifier and the first user parameter in the cache if the operation event on the first tab page is a closed page, so that a session between the user terminal and the first access site is terminated.
Further, the station session termination apparatus further includes:
and the site monitoring module is used for monitoring a second access site corresponding to the second label page.
And the parameter detection module is used for detecting whether a second user parameter field in the second tab page SessionStorage is empty or not if the second access site is the same as the first access site.
And the parameter sharing module is used for copying the first user parameter to the second user parameter field if the second user parameter field is empty.
And the identification updating module is used for copying the second user parameters to the identity identification field in the cache if the second user parameter field is not empty.
And the second event monitoring module is used for monitoring the operation event of the user on the second label page.
And the second information migration module is used for clearing the identity identifier in the cache if the operation event on the second tab page is a page refreshing event, and copying the second user parameter to the identity identifier field in the cache when the page is reloaded on the second tab page.
And the second information clearing module is used for clearing the identity identifier in the cache and the second user parameter if the operation event on the second tab page is a closed page.
Further, the parameter sharing module comprises:
and if the second user parameter is null, modifying the state parameter in the LocalStorage which corresponds to the first label page and the second label page together.
When the state parameter changes, copying the first user parameter to a transition parameter field in the LocalStorage.
When the transfer parameter changes and the second user parameter field is empty, copying the changed transfer parameter to the second user parameter field, and emptying the transfer parameter.
Further, the station session termination apparatus further includes:
and if the operation event of the first tab page is page jump and the target site of the jump is different from the first access site, clearing the identity identifier and the first user parameter in the cache.
Further, the station session termination apparatus further includes:
and if the operation event of the second label page is page jump and the jump target site is different from the second access site, clearing the identity identifier and the second user parameter in the cache.
The process of implementing each function by each module in the site session termination device provided in this embodiment may specifically refer to the description of the first embodiment shown in fig. 1, and is not described herein again.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by functions and internal logic of the process, and should not constitute any limitation to the implementation process of the embodiments of the present application.
It will also be understood that, although the terms first, second, etc. may be used herein to describe various elements in some embodiments of the application, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first table may be named a second table, and similarly, a second table may be named a first table, without departing from the scope of various described embodiments. The first table and the second table are both tables, but they are not the same table.
Fig. 7 is a schematic diagram of a terminal device according to an embodiment of the present application. As shown in fig. 7, the terminal device 7 of this embodiment includes: a processor 70, a memory 71, said memory 71 having stored therein a computer program 72 operable on said processor 70. The processor 70, when executing the computer program 72, implements the steps in the various site session termination method embodiments described above, such as steps 101 through 106 shown in fig. 1. Alternatively, the processor 70, when executing the computer program 72, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the modules 61 to 66 shown in fig. 6.
The terminal device 7 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 70, a memory 71. It will be appreciated by those skilled in the art that fig. 7 is only an example of a terminal device 7 and does not constitute a limitation of the terminal device 7, and may comprise more or less components than those shown, or some components may be combined, or different components, for example, the terminal device may further comprise an input transmission device, a network access device, a bus, etc.
The Processor 70 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 71 may be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7. The memory 71 may also be an external storage device of the terminal device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the terminal device 7. The memory 71 is used for storing the computer program and other programs and data required by the terminal device. The memory 71 may also be used to temporarily store data that has been transmitted or is to be transmitted.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the embodiments of the present application, and they should be construed as being included in the present application.
Claims (10)
1. A method for terminating a site session, comprising:
when a user successfully logs in a first access site through a first tag page, acquiring an identity of the user, which is stored in a cache of a user terminal and corresponds to the first access site, and copying the identity to a first user parameter field in a SessionStorage corresponding to the first tag page;
monitoring the operation event of the user on the first tab page;
if the operation event of the first label page is page refreshing, clearing the identity in the cache, and copying the first user parameter to an identity field in the cache when the first label page reloads the page;
and if the operation event of the first tab page is a closed page, clearing the identity identifier and the first user parameter in the cache so as to terminate the session between the user terminal and the first access site.
2. The site session termination method of claim 1, further comprising:
monitoring a second access site corresponding to a second label page;
if the second access site is the same as the first access site, detecting whether a second user parameter field in the second tab page SessionStorage is empty;
if the second user parameter field is empty, copying the first user parameter to the second user parameter field;
if the second user parameter field is not empty, copying the second user parameter to the identity identification field in the cache;
monitoring the operation event of the user on the second tab page;
if the operation event of the second label page is page refreshing, clearing the identity in the cache, and copying the second user parameter to the identity field in the cache when the second label page reloads the page;
and if the operation event of the second tab page is closing the page, clearing the identity identifier in the cache and the second user parameter.
3. The method of claim 2, wherein copying the first user parameters to the second user parameter field if the second user parameter field is empty comprises:
if the second user parameter is null, modifying the state parameter in the LocalStorage which corresponds to the first tab page and the second tab page together;
when the state parameter changes, copying the first user parameter to a transition parameter field in the LocalStorage;
when the transfer parameter changes and the second user parameter field is empty, copying the changed transfer parameter to the second user parameter field, and emptying the transfer parameter.
4. The site session termination method of claim 1, further comprising:
and if the operation event of the first label page is page jump and the jump target site is different from the first access site, clearing the identity identifier and the first user parameter in the cache.
5. The site session termination method of claim 2, further comprising:
and if the operation event of the second label page is page jump and the target site of the jump is different from the second access site, clearing the identity identifier and the second user parameter in the cache.
6. A station session termination apparatus, comprising:
the system comprises an information backup module, a first access storage module and a second access storage module, wherein the information backup module is used for acquiring an identity of a user stored in a cache of a user terminal and corresponding to a first access site when the user successfully logs in the first access site through a first label page, and copying the identity to a first user parameter field in a SessionStorage corresponding to the first label page;
the first event monitoring module is used for monitoring the operation event of the user on the first tab page;
a first information migration module, configured to clear the identity identifier in the cache if the operation event on the first tab page is a page refresh event, and copy the first user parameter to the identity identifier field in the cache when the page is reloaded on the first tab page;
and the first information clearing module is used for clearing the identity identifier and the first user parameter in the cache if the operation event on the first tab page is a closed page, so that the session between the user terminal and the first access site is terminated.
7. The site session termination apparatus of claim 6, further comprising:
the site monitoring module is used for monitoring a second access site corresponding to the second label page;
a parameter detection module, configured to detect whether a second user parameter field in the SessionStorage of the second tab page is empty if the second access site is the same as the first access site;
the parameter sharing module is used for copying the first user parameters to the second user parameter field if the second user parameter field is empty;
the identification updating module is used for copying the second user parameter to the identity identification field in the cache if the second user parameter field is not empty;
the second event monitoring module is used for monitoring the operation event of the user on the second tab page;
a second information migration module, configured to clear the identity identifier in the cache if the operation event on the second tab page is a page refresh event, and copy the second user parameter to the identity identifier field in the cache when the page is reloaded on the second tab page;
and the second information clearing module is used for clearing the identity identifier in the cache and the second user parameter if the operation event on the second label page is a closed page.
8. The site session termination apparatus of claim 7, wherein the parameter sharing module comprises:
if the second user parameter is null, modifying the state parameter in the LocalStorage which corresponds to the first label page and the second label page together;
when the state parameter changes, copying the first user parameter to a transition parameter field in the LocalStorage;
and when the transfer parameter is changed and the second user parameter field is empty, copying the changed transfer parameter to the second user parameter field and emptying the transfer parameter.
9. A terminal device, characterized in that it comprises a memory, a processor, said memory having stored thereon a computer program operable on said processor, said processor implementing the steps of the method according to any one of claims 1 to 5 when executing said computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a method according to any one of claims 1 to 5.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/083911 WO2020215211A1 (en) | 2019-04-23 | 2019-04-23 | Site session termination method and apparatus, terminal device and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113966590A CN113966590A (en) | 2022-01-21 |
CN113966590B true CN113966590B (en) | 2023-04-14 |
Family
ID=72941289
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201980097493.6A Active CN113966590B (en) | 2019-04-23 | 2019-04-23 | Site session termination method, device, terminal equipment and medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113966590B (en) |
WO (1) | WO2020215211A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114629673A (en) * | 2021-08-20 | 2022-06-14 | 重庆数智逻辑科技有限公司 | Page control method and device, electronic equipment and computer readable storage medium |
CN116569165A (en) * | 2021-11-29 | 2023-08-08 | 京东方科技集团股份有限公司 | Page display method and device, storage medium and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105389393A (en) * | 2015-12-21 | 2016-03-09 | 北京奇虎科技有限公司 | Method and device for adjusting browser display information in browser recommendation list |
WO2017092322A1 (en) * | 2015-12-04 | 2017-06-08 | 乐视控股(北京)有限公司 | Method for operating browser on smart television and smart television |
CN107391768A (en) * | 2017-09-12 | 2017-11-24 | 广州酷狗计算机科技有限公司 | Web data processing method, device, equipment and computer-readable recording medium |
CN108737541A (en) * | 2018-05-18 | 2018-11-02 | 成都九洲迪飞科技有限责任公司 | A kind of WEB conversation management systems and management method |
CN109635210A (en) * | 2018-11-15 | 2019-04-16 | 腾讯科技(深圳)有限公司 | Report method, device, equipment and the storage medium of behavioral data |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170097990A1 (en) * | 2014-03-03 | 2017-04-06 | Michael L. Hamm | Text-sql relational database |
JP6397312B2 (en) * | 2014-11-06 | 2018-09-26 | キヤノン株式会社 | Network system and network system control method |
CN104407937B (en) * | 2014-11-19 | 2018-07-03 | 北京奇虎科技有限公司 | The method and browser of data are loaded in browser |
CN105740244A (en) * | 2014-12-08 | 2016-07-06 | 阿里巴巴集团控股有限公司 | Method and equipment for providing rapid conversation information |
-
2019
- 2019-04-23 CN CN201980097493.6A patent/CN113966590B/en active Active
- 2019-04-23 WO PCT/CN2019/083911 patent/WO2020215211A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017092322A1 (en) * | 2015-12-04 | 2017-06-08 | 乐视控股(北京)有限公司 | Method for operating browser on smart television and smart television |
CN105389393A (en) * | 2015-12-21 | 2016-03-09 | 北京奇虎科技有限公司 | Method and device for adjusting browser display information in browser recommendation list |
CN107391768A (en) * | 2017-09-12 | 2017-11-24 | 广州酷狗计算机科技有限公司 | Web data processing method, device, equipment and computer-readable recording medium |
CN108737541A (en) * | 2018-05-18 | 2018-11-02 | 成都九洲迪飞科技有限责任公司 | A kind of WEB conversation management systems and management method |
CN109635210A (en) * | 2018-11-15 | 2019-04-16 | 腾讯科技(深圳)有限公司 | Report method, device, equipment and the storage medium of behavioral data |
Non-Patent Citations (1)
Title |
---|
曹海涛 ; 胡牧 ; 蒋厚明 ; .基于集群节点间即时拷贝的会话同步技术研究.计算机***应用.2017,(03),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN113966590A (en) | 2022-01-21 |
WO2020215211A1 (en) | 2020-10-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110958218B (en) | Data transmission method based on multi-network communication and related equipment | |
CN103890728B (en) | The method of live migration of virtual machine and server | |
CN104901923B (en) | A kind of virtual machine access mechanism and method | |
US8498966B1 (en) | Systems and methods for adaptively performing backup operations | |
WO2012103827A2 (en) | Method and device for checkpoint and restart of container state | |
CN108989432B (en) | User-mode file sending method, user-mode file receiving method and user-mode file receiving and sending device | |
US10031948B1 (en) | Idempotence service | |
CN113966590B (en) | Site session termination method, device, terminal equipment and medium | |
US11449637B1 (en) | Systems and methods for providing web tracking transparency to protect user data privacy | |
DE102020113808A1 (en) | SYSTEMS AND PROCEDURES FOR MANAGING END POINT SAFETY STATES USING PASSIVE DATA INTEGRITY ATTENTION STATIONS | |
US8751568B1 (en) | Systems and methods for data loss prevention | |
CN109522501A (en) | Content of pages management method and its device | |
CN114461593B (en) | Log writing method and device, electronic device and storage medium | |
CN112966094A (en) | Transaction data processing method, device and system | |
CN109784041B (en) | Event processing method and device, storage medium and electronic device | |
CN105162765B (en) | A kind of cloud data security implementation method sought survival based on docking | |
US10999310B2 (en) | Endpoint security client embedded in storage drive firmware | |
DE102020113691A1 (en) | SYSTEMS AND PROCEDURES FOR MANAGING END POINT SAFETY STATES | |
CN103491141A (en) | Application server and request processing method | |
CN111274176B (en) | Information processing method, electronic equipment, system and storage medium | |
CN111199003B (en) | Multi-webpage window management method, management device and terminal equipment | |
DE102020116244A1 (en) | SYSTEMS AND PROCEDURES FOR PROTECTING AGAINST VICIOUS CONTENT | |
CN109324931B (en) | Method for realizing vmware mount recovery in data de-duplication system | |
CN113568881A (en) | Method, system, equipment and medium for realizing read-write sharing | |
US10915646B2 (en) | Method and apparatus for network secure storage |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20230320 Address after: 518000 406A-409, Building E, Xinghe WORLD Phase II, Minle Community, Minzhi Street, Longhua District, Shenzhen City, Guangdong Province Applicant after: SHENZHEN MAINWAY TECHNOLOGY CO.,LTD. Address before: Unit KL, 6th floor, block B, building 7, Baoneng Science Park, Qinghu Industrial Park, Qingxiang Road, Longhua street, Longhua District, Shenzhen, Guangdong 518000 Applicant before: SECZONE TECHNOLOGY Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |