CN106790635B - Cookie information management method and server - Google Patents
Cookie information management method and server Download PDFInfo
- Publication number
- CN106790635B CN106790635B CN201710010587.8A CN201710010587A CN106790635B CN 106790635 B CN106790635 B CN 106790635B CN 201710010587 A CN201710010587 A CN 201710010587A CN 106790635 B CN106790635 B CN 106790635B
- Authority
- CN
- China
- Prior art keywords
- information
- cookie
- cookie information
- page
- server
- 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
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/146—Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
- H04L67/5682—Policies or rules for updating, deleting or replacing the stored data
Abstract
The embodiment of the invention provides a cookie information management method and a server, wherein the cookie information management method comprises the following steps: after receiving page request information sent by terminal equipment, acquiring first cookie information and first version information corresponding to the first cookie information in the page request information; when the first cookie information is determined to comprise cookie information of a first type, judging whether the first version information is the latest version information, wherein the first type is the type of the cookie information maintained by the server; if the judgment result is negative, a cookie information updating instruction is sent to the terminal device, and the cookie information updating instruction comprises latest version information and latest cookie information corresponding to the latest version information, so that the terminal device updates the first version information and the first cookie information according to the cookie information updating instruction. The method and the device are used for improving the accuracy of the terminal equipment in page loading.
Description
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a cookie information management method and a server.
Background
Currently, in the process of accessing a website by a terminal device through a browser, cookie information is generated in the terminal device, and the terminal device manages the cookie information.
In an actual application process, the content in the cookie information may be user information generated by the terminal device, such as a user name, a password, and the like, and the content in the cookie information may also be page information generated by the server. When the terminal equipment requests page information from the server, the terminal equipment carries cookie information corresponding to a page to be requested in the page request information, so that the server generates the page information according to the cookie information in the page request information. However, in the actual application process, after the website is upgraded, part of the page information provided by the server to the terminal device may change, so that the page information in the cookie information stored in the terminal device does not match the actual page information of the website, and thus, when the server generates the page information according to the cookie information in the page request information, correct page information cannot be generated, so that an error occurs in a page loaded by the terminal device, and the accuracy of loading the page by the terminal device is low.
Disclosure of Invention
The embodiment of the invention provides a cookie information management method and a server. The accuracy of the terminal equipment for loading the page is improved.
In a first aspect, an embodiment of the present invention provides a cookie information management method, which is applied to a server, and the method includes:
after page request information sent by terminal equipment is received, first cookie information and first version information corresponding to the first cookie information are obtained from the page request information;
when the first cookie information is determined to comprise first type cookie information, judging whether the first version information is the latest version information, wherein the first type cookie information is maintained by the server;
if the judgment result is negative, a cookie information updating instruction is sent to the terminal device, and the cookie information updating instruction comprises the latest version information and the latest cookie information corresponding to the latest version information, so that the terminal device updates the first version information and the first cookie information according to the cookie information updating instruction.
In one possible embodiment, when it is determined that the first type of cookie information is not included in the first cookie information, the method further includes:
acquiring a first domain name corresponding to the first cookie information;
judging whether the first domain name corresponds to second cookie information of the first type;
and if so, acquiring the second cookie information and second version information corresponding to the first domain name, and sending the second cookie information and the second version information to the terminal equipment, so that the terminal equipment updates the first cookie information according to the second cookie information and correspondingly stores the second version information.
In another possible implementation, the determining whether the first version information is the latest version information includes:
acquiring a first domain name corresponding to the first cookie information;
acquiring third version information corresponding to the first domain name from the configuration information of the server, wherein the third version information is latest version information corresponding to the first domain name;
and judging whether the first version information is the latest version information or not according to the first version information and the third version information.
In another possible implementation manner, if it is determined that the first version information is the latest version information, the method further includes:
acquiring page information corresponding to the page request information according to the first cookie information;
and sending the page information to the terminal equipment so that the terminal equipment displays a page according to the page information.
In another possible implementation manner, after sending the cookie information updating instruction to the terminal device, the method further includes:
acquiring page information corresponding to the page request information according to the latest cookie information;
and sending the page information to the terminal equipment so that the terminal equipment displays a page according to the page information.
In a second aspect, an embodiment of the present invention provides a server, including a first obtaining module, a first determining module, and a sending module, where,
the first obtaining module is used for obtaining first cookie information and first version information corresponding to the first cookie information in the page request information after receiving the page request information sent by the terminal equipment;
the first judging module is used for judging whether the first version information is the latest version information or not when the first cookie information is determined to comprise cookie information of a first type, wherein the first type is the type of the cookie information maintained by the server;
the sending module is configured to send a cookie information updating instruction to the terminal device when the determining module determines that the first version information is not the latest version information, where the cookie information updating instruction includes the latest version information and latest cookie information corresponding to the latest version information, so that the terminal device updates the first version information and the first cookie information according to the cookie information updating instruction.
In a possible implementation manner, the server further includes a second obtaining module, a second judging module and a third obtaining module, wherein,
the second obtaining module is configured to, when it is determined that the first cookie information does not include cookie information of a first type, obtain a first domain name corresponding to the first cookie information;
the second judging module is configured to judge whether the first domain name corresponds to second cookie information of the first type;
the third obtaining module is configured to obtain the second cookie information and second version information corresponding to the first domain name when the second determining module determines that the first domain name corresponds to the second cookie information of the first type;
the sending module is further configured to send the second cookie information and the second version information to the terminal device, so that the terminal device updates the first cookie information according to the second cookie information and correspondingly stores the second version information.
In another possible implementation manner, the first determining module is specifically configured to:
acquiring a first domain name corresponding to the first cookie information;
acquiring third version information corresponding to the first domain name from the configuration information of the server, wherein the third version information is latest version information corresponding to the first domain name;
and judging whether the first version information is the latest version information or not according to the first version information and the third version information.
In another possible embodiment, the server further comprises a fourth obtaining module, wherein,
the fourth obtaining module is configured to, when the first determining module determines that the first version information is the latest version information, obtain, according to the first cookie information, page information corresponding to the page request information;
the sending module is further configured to send the page information to the terminal device, so that the terminal device displays a page according to the page information.
In another possible embodiment, the server further comprises a fifth obtaining module, wherein,
the fifth obtaining module is configured to, after the sending module sends a cookie information update instruction to the terminal device, obtain, according to the latest cookie information, page information corresponding to the page request information;
the sending module is further configured to send the page information to the terminal device, so that the terminal device displays a page according to the page information.
According to the cookie information management method and the server provided by the embodiment of the invention, when the terminal equipment sends the page request information to the server, the page request information carries the first cookie information corresponding to the domain name of the page to be requested and the first version information corresponding to the first cookie information. Correspondingly, after the server receives the page request information sent by the terminal device, the server can acquire the first cookie information and the first version information from the page request information, and judge whether the first cookie information stored in the terminal device is the latest cookie information according to the latest version information stored locally, if not, the terminal device is controlled to update the first cookie information and the first version information stored in the terminal device, so that the cookie information and the version information in the terminal device are the latest, further, the server is prevented from generating wrong page information according to the cookie information, further, the terminal device is prevented from loading wrong pages, and the accuracy of loading the pages by the terminal device is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of a cookie information management method according to an embodiment of the present invention;
fig. 2 is a first flowchart illustrating a cookie information management method according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a cookie information management method according to an embodiment of the present invention;
fig. 4 is a first schematic structural diagram of a server according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic view of an application scenario of a cookie information management method according to an embodiment of the present invention. Referring to fig. 1, the terminal device 101 and the server 102 are included. The terminal device 101 may be a device such as a mobile phone, a computer, or a television, and the terminal device 101 may obtain a web page (hereinafter, referred to as a page) from the request server 102 through an application program such as a browser. The terminal device 101 stores a plurality of pieces of cookie information, cookie information corresponding to each domain name may be stored in one file, and cookie information corresponding to each domain name corresponds to one version information. The server 102 stores a plurality of domain names and latest version information corresponding to each domain name, and when the server updates a page corresponding to a domain name, the server updates the latest version information of the domain name.
In the application, when a terminal device 101 requests a server 102 to acquire a page, the terminal device carries corresponding cookie information and version information in the page request, the server determines whether the cookie information and the version information in the terminal device need to be updated according to the cookie information and the version information carried in the page request and the locally stored latest version information, and when the cookie information and the version information need to be updated, the server 102 sends a corresponding update instruction to the terminal device so that the terminal device 101 updates the stored cookie information. Therefore, the cookie information in the terminal equipment can be ensured to be the latest cookie information, and the terminal equipment can be prevented from loading wrong page information according to the cookie information, so that the page loading accuracy is improved.
The technical means shown in the present application will be described in detail below with reference to specific examples. It should be noted that the following specific embodiments may be combined with each other, and the description of the same or similar concepts in different embodiments is omitted.
Fig. 2 is a first flowchart illustrating a cookie information management method according to an embodiment of the present invention. The execution subject of the method may be a server, please refer to fig. 2, and the method may include:
s201, after receiving page request information sent by the terminal device, acquiring first cookie information and first version information corresponding to the first cookie information in the page request information.
In order to facilitate understanding of the present application, first, a method for storing cookie information by a terminal device is described in detail below. In the terminal device, cookie information having the same domain name, which may be a primary domain name, a secondary domain name, a tertiary domain name, etc., is typically stored in the same file. For example, all cookie information with a secondary domain name of a.b.com may be stored in file 1, and all cookie information with a secondary domain name of a.c.com may be stored in file 2.
All the cookie information in the same file corresponds to the same version information, and the version information corresponding to the cookie information in different files can be the same or different. The version information corresponding to the cookie information is the version information of the page corresponding to the corresponding domain name in the server when the terminal device acquires the cookie information from the server. For example, the storage format of the cookie information in the terminal device may be as shown in table 1:
TABLE 1
In the cookie information shown in table 1, assuming that domain name 1 is a secondary domain name, the secondary domain names of cookie information 1-cookie information 10 are the same. Alternatively, in the cookie information 1 to the cookie information 10, it is possible that part of the cookie information is cookie information generated by the terminal device and related to user information, and part of the cookie information is cookie information generated by the server and related to page information. When the terminal device acquires cookie information 1-cookie information 10, which is related to page information, the version information of the page corresponding to the domain name 1 in the server is 2. It should be noted that when the server updates the website, part of the pages of the website may be updated, and therefore, version information of pages corresponding to different domain names in the server may be different.
In the actual application process, when the terminal device needs to request the server to acquire a page, the terminal device sends page request information to the server. The terminal device also obtains first cookie information corresponding to the first domain name and first version information corresponding to the first cookie information according to the first domain name corresponding to the page to be requested, and carries the first cookie information and the first version information in the page request information. The first cookie information may include a plurality of pieces of cookie information. For example, suppose that the terminal device respectively stores cookie information according to the secondary domain names, when the terminal device requests the first page, the terminal device obtains the secondary domain name of the first page, and obtains the first cookie information and the first version information corresponding to the secondary domain name in the terminal device.
In the process of acquiring the page request information sent by the terminal device, the server may analyze the page request information to acquire the first cookie information and the first version information in the page request information.
S202, when the first cookie information is determined to comprise the first type cookie information, judging whether the first version information is the latest version information, wherein the first type is the type of the cookie information maintained by the server.
In the embodiment of the invention, the types of the cookie information can be divided into two types, one type is cookie information which is generated by a server and is related to page information, and the cookie information is maintained by the server; the other is cookie information generated by the terminal device and related to personal information of the user, and the cookie information is partially maintained by the terminal device. Optionally, when the terminal device or the server generates the cookie information, the cookie information may be carried with a type of the cookie information.
After the server obtains the first cookie information, the server obtains the type of each piece of cookie information in the first cookie information, and judges whether the first type of cookie information exists in a plurality of pieces of cookie information included in the first cookie information.
When the server determines that the first cookie information includes the first type of cookie information, the server determines whether the first version information is the latest version information. Optionally, the server may obtain a first domain name corresponding to the first cookie information, obtain third version information corresponding to the first domain name from the configuration information of the server, where the third version information is latest version information corresponding to the first domain name, and determine whether the first version information is latest version information according to the first version information and the third version information. Specifically, if the first version information is the same as the third version information, it is determined that the first version information is the latest version information, otherwise, the first version information is not the latest version information.
S203, if the judgment result is negative, sending a cookie information updating instruction to the terminal device, wherein the cookie information updating instruction comprises the latest version information and the latest cookie information corresponding to the latest version information, so that the terminal device updates the first version information and the first cookie information according to the cookie information updating instruction.
If the server determines that the first version information of the first cookie information is not the latest version information, the server needs to update the first cookie information in the terminal device. Optionally, the server may obtain the latest cookie information corresponding to the first domain name, and send a cookie information update instruction to the terminal device, where the cookie information update instruction includes the latest version information and the latest cookie information corresponding to the latest version information.
After the terminal device receives the cookie information updating instruction, optionally, the terminal device may update the first version information to the latest version information, and replace the first cookie information with the latest cookie information, optionally, the terminal device may also replace the first type cookie information in the first cookie information with the latest cookie information, and the cookie information of other types remains unchanged. Of course, the terminal device may also update the first version information to the latest version information, and delete the first cookie information, so that the terminal device updates the first cookie information when requesting a page from the server next time.
According to the cookie information management method provided by the embodiment of the invention, when the terminal equipment sends the page request information to the server, the page request information carries the first cookie information corresponding to the domain name of the page to be requested and the first version information corresponding to the first cookie information. Correspondingly, after the server receives the page request information sent by the terminal device, the server can acquire the first cookie information and the first version information from the page request information, and judge whether the first cookie information stored in the terminal device is the latest cookie information according to the latest version information stored locally, if not, the terminal device is controlled to update the first cookie information and the first version information stored in the terminal device, so that the cookie information and the version information in the terminal device are the latest, and further, the server is prevented from generating wrong page information according to the cookie information, and further, the terminal device is prevented from loading wrong pages.
On the basis of the embodiment shown in fig. 2, optionally, when the server determines that the first cookie information does not include the first type of cookie information, it may further continue to determine whether the second cookie information needs to be sent to the terminal device. Specifically, please refer to the embodiment shown in fig. 3.
Fig. 3 is a flowchart illustrating a cookie information management method according to an embodiment of the present invention. On the basis of the embodiment shown in fig. 2, referring to fig. 3, the method may include:
s301, after receiving the page request information sent by the terminal device, acquiring the first cookie information and the first version information corresponding to the first cookie information from the page request information.
It should be noted that the execution process of S301 may refer to the execution process of S201, and is not described herein again.
S302, judging whether the first cookie information comprises the first type cookie information.
If so, executing S303-S306.
If not, S307-S311 are executed.
S303, judging whether the first version information is the latest version information.
If yes, go to step S304.
If not, S305-S306 are executed.
It should be noted that the execution process of S303 may refer to the execution process of S202, and is not described herein again.
S304, according to the first cookie information, acquiring page information corresponding to the page request information, and sending the page information to the terminal equipment.
S305, sending a cookie information updating instruction to the terminal device so that the terminal device updates the first version information and the first cookie information according to the cookie information updating instruction.
It should be noted that the execution process of S305 may refer to the execution process of S203, and is not described herein again.
S306, according to the latest cookie information, page information corresponding to the page request information is obtained, and the page information is sent to the terminal equipment.
S307, acquiring a first domain name corresponding to the first cookie information.
It should be noted that, in the embodiment of fig. 2, S202 already describes in detail the process of obtaining the first domain name, and details are not described here again.
S308, judging whether the first domain name corresponds to the second cookie information of the first type.
If so, S309-S310 are performed.
If not, go to S311.
Optionally, whether each domain name corresponds to cookie information may be preset in the server, for example, the configuration information shown in table 2 may be set:
TABLE 2
Domain name | Whether there is a first type of cookie information corresponding thereto |
Domain name 1 | Is that |
Domain name 2 | Whether or not |
Domain name 3 | Whether or not |
Domain name 4 | Is that |
…… | …… |
Accordingly, the server may determine whether the first domain name corresponds to the second cookie information of the first type according to the configuration information shown in table 2.
S309, obtaining second cookie information and second version information corresponding to the first domain name, and sending the second cookie information and the second version information to the terminal device.
Optionally, after the server sends the second cookie information and the second version information to the terminal device, the server updates the first cookie information according to the second cookie information and correspondingly stores the second version information. Optionally, the terminal device may add the second cookie information to the first cookie information. Before the terminal device updates the first cookie information, the first cookie information does not include the first type of cookie information, so that before the terminal device updates the first cookie information, the first cookie information does not have corresponding version information. Correspondingly, the terminal device may directly store the updated cookie information and the second version information in a corresponding manner.
S310, acquiring page information corresponding to the page request information according to the second cookie information, and sending the page information to the terminal equipment.
After the server sends the second cookie information and the second version information to the terminal device, the server also obtains page information corresponding to the page request information according to the first cookie information and the second cookie information, and sends the page information to the terminal device, so that the terminal device displays a page according to the page information.
S311, acquiring page information corresponding to the page request information, and sending the page information to the terminal equipment.
And when the cookie information corresponding to the current page does not exist in the server, the server directly acquires the page information corresponding to the page request information.
The method shown in the embodiment of fig. 3 is described in detail below by way of specific examples.
For example, it is assumed that the cookie information is stored in the terminal device according to the secondary domain name. When the terminal equipment needs to request the page 1 from the server, the terminal equipment acquires the URL address of the page 1, and the terminal equipment acquires the second-level domain name a.b.com corresponding to the page 1 according to the URL address of the page 1. Com, the terminal device locally obtains 10 pieces of cookie information corresponding to a.b.com, and the cookie information is respectively recorded as cookie information 1-cookie information 10, and then the cookie information 1-cookie information 5 is assumed to be of a first type (page information maintained by a server), and the cookie information 6-cookie information 10 is assumed to be of a second type (user personal information maintained by the terminal device). Further, it is assumed that the version information of the 10 pieces of cookie information is "2".
The terminal device sends page request information corresponding to the page 1 to the server, and the page request information carries cookie information 1, cookie information 10 and version information 2.
After the server receives the page request information, the server acquires cookie information 1-cookie information 10, and version information "2" in the page request information. Since the server determines that the first type of cookie information is included in the 10 pieces of cookie information, the server continues to determine whether the version information "2" is the latest version information. Com, the server obtains the version information "3" corresponding to the locally stored a.b.com, and therefore, it can be judged that the version information "2" corresponding to the cookie information 1-10 in the terminal device is not the latest version information.
Com, the server acquires the latest cookie information corresponding to the a.b.com, and records the latest cookie information as cookie information 11-15. The server transmits a cookie information update instruction in which cookie information 11-cookie information 15 and latest version information "3" are carried to the terminal device.
And the terminal equipment deletes the cookie information 1-5 corresponding to the a.b.com according to the received cookie information updating instruction, and stores the cookie information 11-15 in the file corresponding to the a.b.com. The terminal device also updates the version information "2" to the version information "3".
After the server transmits a cookie information update instruction to the terminal device, the server generates page information from the cookie information 11-cookie information 15, cookie information 6-cookie information 10, and other information (page frame information, etc.), and transmits the generated page information to the terminal device, so that the terminal device performs page display based on the page information.
Fig. 4 is a first schematic structural diagram of a server according to an embodiment of the present invention. Referring to fig. 4, the server may include a first obtaining module 11, a first judging module 12 and a sending module 13, wherein,
the first obtaining module 11 is configured to, after receiving page request information sent by a terminal device, obtain first cookie information and first version information corresponding to the first cookie information in the page request information;
the first determining module 12 is configured to, when it is determined that the first cookie information includes cookie information of a first type, determine whether the first version information is latest version information, where the first type is a type of cookie information maintained by the server;
the sending module 13 is configured to send a cookie information update instruction to the terminal device when the determining module determines that the first version information is not the latest version information, where the cookie information update instruction includes the latest version information and the latest cookie information corresponding to the latest version information, so that the terminal device updates the first version information and the first cookie information according to the cookie information update instruction.
The server provided by the embodiment of the present invention may execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
Fig. 5 is a schematic structural diagram of a server according to an embodiment of the present invention. On the basis of the embodiment shown in fig. 4, please refer to fig. 5, the server further includes a second obtaining module 14, a second determining module 15, and a third obtaining module 16, wherein,
the second obtaining module 14 is configured to, when it is determined that the first cookie information does not include cookie information of a first type, obtain a first domain name corresponding to the first cookie information;
the second determining module 15 is configured to determine whether the first domain name corresponds to the second cookie information of the first type;
the third obtaining module 16 is configured to, when the second determining module determines that the first domain name corresponds to the second cookie information of the first type, obtain the second cookie information and second version information corresponding to the first domain name;
the sending module 13 is further configured to send the second cookie information and the second version information to the terminal device, so that the terminal device updates the first cookie information according to the second cookie information and correspondingly stores the second version information.
In a possible implementation manner, the first determining module 12 is specifically configured to:
acquiring a first domain name corresponding to the first cookie information;
acquiring third version information corresponding to the first domain name from the configuration information of the server, wherein the third version information is latest version information corresponding to the first domain name;
and judging whether the first version information is the latest version information or not according to the first version information and the third version information.
In another possible embodiment, the server further comprises a fourth obtaining module 17, wherein,
the fourth obtaining module 17 is configured to, when the first determining module 12 determines that the first version information is the latest version information, obtain, according to the first cookie information, page information corresponding to the page request information;
the sending module 13 is further configured to send the page information to the terminal device, so that the terminal device displays a page according to the page information.
In another possible embodiment, the server further comprises a fifth obtaining module 18, wherein,
the fifth obtaining module 18 is configured to, after the sending module 13 sends a cookie information update instruction to the terminal device, obtain, according to the latest cookie information, page information corresponding to the page request information;
the sending module 13 is further configured to send the page information to the terminal device, so that the terminal device displays a page according to the page information.
The server provided by the embodiment of the present invention may execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. A cookie information management method applied to a server, the method comprising:
after receiving page request information sent by a terminal device, acquiring first cookie information and first version information corresponding to the first cookie information in the page request information, wherein the first cookie information comprises a plurality of pieces of cookie information, the cookie information has the same domain name, the first cookie information comprises cookie information generated by the server and related to the page information, and the first version information is version information of a page corresponding to the corresponding domain name in the server when the terminal device acquires the first cookie information from the server;
when the first cookie information is determined to comprise first type cookie information, judging whether the first version information is latest version information, wherein the first type cookie information is cookie information which is generated by the server and is related to page information, and part of the cookie information is maintained by the server;
if the judgment result is negative, a cookie information updating instruction is sent to the terminal device, and the cookie information updating instruction comprises the latest version information and the latest cookie information corresponding to the latest version information, so that the terminal device updates the first version information and the first cookie information according to the cookie information updating instruction.
2. The method of claim 1, wherein upon determining that the first cookie information does not comprise a first type of cookie information, the method further comprises:
acquiring a first domain name corresponding to the first cookie information;
judging whether the first domain name corresponds to second cookie information of the first type;
and if so, acquiring the second cookie information and second version information corresponding to the first domain name, and sending the second cookie information and the second version information to the terminal equipment, so that the terminal equipment updates the first cookie information according to the second cookie information and correspondingly stores the second version information.
3. The method of claim 1 or 2, wherein determining whether the first version information is the latest version information comprises:
acquiring a first domain name corresponding to the first cookie information;
acquiring third version information corresponding to the first domain name from the configuration information of the server, wherein the third version information is latest version information corresponding to the first domain name;
and judging whether the first version information is the latest version information or not according to the first version information and the third version information.
4. The method according to claim 1 or 2, wherein if it is determined that the first version information is the latest version information, the method further comprises:
acquiring page information corresponding to the page request information according to the first cookie information;
and sending the page information to the terminal equipment so that the terminal equipment displays a page according to the page information.
5. The method according to claim 1 or 2, after sending the cookie information update instruction to the terminal device, further comprising:
acquiring page information corresponding to the page request information according to the latest cookie information;
and sending the page information to the terminal equipment so that the terminal equipment displays a page according to the page information.
6. A server is characterized by comprising a first acquisition module, a first judgment module and a sending module, wherein,
the first obtaining module is configured to, after receiving page request information sent by a terminal device, obtain first cookie information and first version information corresponding to the first cookie information in the page request information, where the first cookie information includes a plurality of pieces of cookie information, and the cookie information has a same domain name, the first cookie information includes cookie information generated by the server and related to page information, and the first version information is version information of a page corresponding to a corresponding domain name in the server when the terminal device obtains the first cookie information from the server;
the first judging module is used for judging whether the first version information is the latest version information or not when the first cookie information is determined to comprise the first type cookie information, the first type cookie information is cookie information which is generated by the server and is related to page information, and the partial cookie information is maintained by the server;
the sending module is configured to send a cookie information updating instruction to the terminal device when the determining module determines that the first version information is not the latest version information, where the cookie information updating instruction includes the latest version information and latest cookie information corresponding to the latest version information, so that the terminal device updates the first version information and the first cookie information according to the cookie information updating instruction.
7. The server according to claim 6, further comprising a second obtaining module, a second judging module and a third obtaining module, wherein,
the second obtaining module is configured to, when it is determined that the first cookie information does not include cookie information of a first type, obtain a first domain name corresponding to the first cookie information;
the second judging module is configured to judge whether the first domain name corresponds to second cookie information of the first type;
the third obtaining module is configured to obtain the second cookie information and second version information corresponding to the first domain name when the second determining module determines that the first domain name corresponds to the second cookie information of the first type;
the sending module is further configured to send the second cookie information and the second version information to the terminal device, so that the terminal device updates the first cookie information according to the second cookie information and correspondingly stores the second version information.
8. The server according to claim 6 or 7, wherein the first determining module is specifically configured to:
acquiring a first domain name corresponding to the first cookie information;
acquiring third version information corresponding to the first domain name from the configuration information of the server, wherein the third version information is latest version information corresponding to the first domain name;
and judging whether the first version information is the latest version information or not according to the first version information and the third version information.
9. The server according to claim 6 or 7, characterized in that the server further comprises a fourth acquisition module, wherein,
the fourth obtaining module is configured to, when the first determining module determines that the first version information is the latest version information, obtain, according to the first cookie information, page information corresponding to the page request information;
the sending module is further configured to send the page information to the terminal device, so that the terminal device displays a page according to the page information.
10. The server according to claim 6 or 7, characterized in that the server further comprises a fifth obtaining module, wherein,
the fifth obtaining module is configured to, after the sending module sends a cookie information update instruction to the terminal device, obtain, according to the latest cookie information, page information corresponding to the page request information;
the sending module is further configured to send the page information to the terminal device, so that the terminal device displays a page according to the page information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710010587.8A CN106790635B (en) | 2017-01-06 | 2017-01-06 | Cookie information management method and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710010587.8A CN106790635B (en) | 2017-01-06 | 2017-01-06 | Cookie information management method and server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106790635A CN106790635A (en) | 2017-05-31 |
CN106790635B true CN106790635B (en) | 2020-11-24 |
Family
ID=58951096
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710010587.8A Active CN106790635B (en) | 2017-01-06 | 2017-01-06 | Cookie information management method and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106790635B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108388657B (en) * | 2018-03-06 | 2022-04-05 | 五八有限公司 | Cookie storage method, device, equipment and readable storage medium |
CN110445744B (en) * | 2018-05-02 | 2022-06-28 | 阿里巴巴集团控股有限公司 | Data processing method and device |
CN110012127B (en) * | 2019-04-09 | 2022-08-09 | 吉旗(成都)科技有限公司 | Cross-domain name cookie sharing method and device, storage medium and terminal |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102769625A (en) * | 2012-07-25 | 2012-11-07 | 亿赞普(北京)科技有限公司 | Client-side Cookie information acquisition method and device |
CN104516973A (en) * | 2014-12-26 | 2015-04-15 | 北京奇虎科技有限公司 | Method and device for accessing page |
US9219787B1 (en) * | 2014-11-26 | 2015-12-22 | Ensighten, Inc. | Stateless cookie operations server |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160036929A1 (en) * | 2011-07-01 | 2016-02-04 | Google Inc. | Long term targeting of content items |
-
2017
- 2017-01-06 CN CN201710010587.8A patent/CN106790635B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102769625A (en) * | 2012-07-25 | 2012-11-07 | 亿赞普(北京)科技有限公司 | Client-side Cookie information acquisition method and device |
US9219787B1 (en) * | 2014-11-26 | 2015-12-22 | Ensighten, Inc. | Stateless cookie operations server |
CN104516973A (en) * | 2014-12-26 | 2015-04-15 | 北京奇虎科技有限公司 | Method and device for accessing page |
Also Published As
Publication number | Publication date |
---|---|
CN106790635A (en) | 2017-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110058873B (en) | Application page updating method, device, equipment and storage medium | |
US9864736B2 (en) | Information processing apparatus, control method, and recording medium | |
CN102761623B (en) | Resource self-adaptive joins method for down loading, system, data storage server and communication system | |
CN106790635B (en) | Cookie information management method and server | |
CN108776592B (en) | Page construction method, device, equipment and storage medium | |
US20160092441A1 (en) | File Acquiring Method and Device | |
JP6779307B2 (en) | Method and device for page display | |
CN104267921A (en) | Page display control method and server | |
CN114153856A (en) | Host data double-writing method and device | |
US9665732B2 (en) | Secure Download from internet marketplace | |
CN111797334B (en) | Website access method and device, electronic equipment and storage medium | |
US20140331117A1 (en) | Application-based dependency graph | |
CN110119388B (en) | File reading and writing method, device, system, equipment and computer readable storage medium | |
CN105610596B (en) | Resource directory management method and network terminal | |
CN111562949B (en) | Model file loading method and device | |
CN106230988A (en) | A kind of processing method for playing video files and device | |
CN111159160A (en) | Version rollback method and device, electronic equipment and storage medium | |
US20150163268A1 (en) | System and Methods for Dynamically Loading a Compatible Media Player Based on a User's Environment | |
CN114327453A (en) | Page display method, device, equipment and storage medium | |
CN109032747B (en) | Data updating method and device | |
CN108197157B (en) | Method, apparatus and computer-readable storage medium for managing data to be stored | |
CN112286545B (en) | Data updating method, device, equipment and storage medium | |
CN107612961B (en) | System software downloading/upgrading method, server and terminal | |
CN111125142B (en) | Data updating method and system | |
CN113326456B (en) | Webpage resource acquisition method, device, equipment, system and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |