CN103368964A - Cookie dynamic loading method - Google Patents

Cookie dynamic loading method Download PDF

Info

Publication number
CN103368964A
CN103368964A CN2013103031596A CN201310303159A CN103368964A CN 103368964 A CN103368964 A CN 103368964A CN 2013103031596 A CN2013103031596 A CN 2013103031596A CN 201310303159 A CN201310303159 A CN 201310303159A CN 103368964 A CN103368964 A CN 103368964A
Authority
CN
China
Prior art keywords
cookie
configuration file
website
loading method
information
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.)
Granted
Application number
CN2013103031596A
Other languages
Chinese (zh)
Other versions
CN103368964B (en
Inventor
廖耀华
周东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201310303159.6A priority Critical patent/CN103368964B/en
Publication of CN103368964A publication Critical patent/CN103368964A/en
Application granted granted Critical
Publication of CN103368964B publication Critical patent/CN103368964B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

Provided is a Cookie dynamic loading method. The Cookie dynamic loading method includes the steps of step 1, generating different Cookie management strategies used for refreshing Cookies dynamically aiming at different websites, step 2, associating the Cookie management strategies with the corresponding websites and storing the Cookie management strategies in configured files, and step 3, loading the Cookies dynamically according to the Cookie management strategies of the websites by searching the configured files when the websites are visited in later stages. By means of the Cookie dynamic loading method, after login for the first time, a user can login through refreshing the Cookies, and the login state can be kept by refreshing the Cookies after login.

Description

A kind of Cookie dynamic loading method
Technical field
The present invention relates to the web application technology, more specifically, relate to the Cookie dynamic loading method.
Background technology
There is different login modes different websites, and generally when logining first, the browser cookie information can be returned in the website, is stored in this locality.During user's access websites next time, can judge whether Website login of registered user.The user may be pointed out: whether keep user profile when entering this website in order to simplify the login formality next time.But even Cookie has been arranged, some websites also want user's input validation code to carry out authentication, and this has increased the consistency of user's login.Another situation is, certain page of website occurs unusual, causes service that failure is provided,
Summary of the invention
To this, the invention provides a kind of Cookie dynamic loading method, comprising: step 1): generate the different Cookie management strategies that is used for dynamic refresh Cookie for different websites; Step 2): Cookie management strategy and corresponding website are associated, be kept in the configuration file; Step 3): during access websites, inquire about described configuration file, according to the Cookie management strategy dynamic load Cookie of described website afterwards.
The present invention can simplify the operation of user's Website login, is logining by refreshing Cookie so that the user logins afterwards first, and keep logging status by refreshing Cookie after login.
Description of drawings
Fig. 1 is the flow chart of method of the present invention;
Fig. 2 is the operational flowchart of method of the present invention.
Embodiment
Shown in Fig. 1-2, inventive method of the present invention comprises:
Step 1): generate the different Cookie management strategies that is used for dynamic refresh Cookie for different websites.
Step 2): Cookie management strategy and corresponding website are associated, be kept in the configuration file.
More specifically, the Cookie management strategy has been preserved, cookie information that should be relevant with this account login after the account login, and the information of dynamic refresh Cookie how.In addition, the cookie information of preserving in the configuration file is corresponding with the website, and is related uniquely mutually.
Step 3): during access websites, inquire about described configuration file, according to the Cookie management strategy dynamic load Cookie of described website afterwards.
Used cookie information is kept in the configuration file when wherein, loading Cookie.Dynamic load comprises dynamic refresh Cookie, and refresh time can preset or dynamic setting, for example refreshes once every half an hour.
Dynamic refresh Cookie refreshes when also being included in page exception except periodic refreshing.During page exception, webpage comprises a string character string usually, for example " server is busy, please tries after a while again ".Character string can be extracted from the unusual page, is used for distinguishing the normal page and the unusual page.The feature of the different website abnormal pages is different.Website service is obtained unsuccessfully and can be judged by the state of the page, and after the page exception, account can't the normal request data, and the website has abnormal prompt, just can detect whether service acquisition failure by these special pages.
Therefore, described step 3 can also comprise:
Step 3-1): during page exception, the unusual page after extracting each website service and obtaining unsuccessfully, and the feature of this unusual page is kept in the configuration file.
Step 3-2): after the login, detect page status, if the page occurs unusual, with the feature of the unusual page with and configuration file in the identical feature of the unusual page compare, if identical, the Cookie management strategy that then loads this website is finished the dynamic refresh of Cookie, thereby makes the page remain logging status.
In an embodiment of Cookie dynamic loading method of the present invention, this embodiment has described another kind of situation: Cookie is not set in the request header.This Cookie dynamic loading method comprises:
Step 1): during access websites, if Cookie is not set in the request header, then record the cookie information relevant with login that the website is returned first, described cookie information and described site information are kept in the configuration file accordingly.
Preferably, in configuration file, preserve with the right form of website name-cookie information.
Alternatively, a website and corresponding cookie information thereof are kept in the configuration file.
Step 2): during access websites, inquire about described configuration file afterwards, in the request header of webpage, insert cookie information corresponding to described website.
At this moment, cookie information has been kept in the described configuration file, can read from described configuration file and logins relevant cookie information.Namely, login by refreshing cookie information, do not login and do not need the user for example again to input username and password.
Further, when access websites, inquire about described configuration file, cookie information is write among the web object CookieStore, load cookie information by described web object.
Step 3): during logining, dynamic refresh Cookie.
Dynamic refresh Cookie comprises dual mode, and the first is periodic refreshing, and the second is to refresh when obtaining the website service failure.
When obtaining the website service failure, dynamic refresh Cookie comprises:
Step 3-1): the unusual page after extracting each website service and obtaining unsuccessfully, and the feature of this unusual page is kept in the configuration file.
During page exception, webpage comprises a string character string usually, for example " server is busy, please tries after a while again ".Character string can be extracted from the unusual page, is used for distinguishing the normal page and the unusual page.The feature of the different website abnormal pages is different.
Website service is obtained unsuccessfully and can be judged by the state of the page, and after the page exception, account can't the normal request data, and the website has abnormal prompt, just can detect whether service acquisition failure by these special pages.
Step 3-2): detect page status, unusual if the page occurs, with the feature of the unusual page with and configuration file in the page is identical unusually feature compare, if identical, dynamic refresh Cookie then, thus make the page remain logging status.
In the another embodiment of Cookie dynamic loading method of the present invention, this embodiment has described another kind of situation: be provided with Cookie in the request header.
If be provided with Cookie in the request header, this cookie information on request header meeting automatic band during each access destination website.The cookie information that Http request header acquiescence carries, generally some basic information just such as area, id, expired time etc., do not relate to and login relevant cookie information, such as key etc.
Cookie dynamic loading method of the present invention comprises:
Step 1): first during access websites, the cookie information that the record website is returned, the described cookie information that returns comprises that next access need be loaded into the acquiescence cookie information in the request header, and the cookie information relevant with login.
Step 2): the described cookie information that returns and described website are stored in the configuration file accordingly.
Preferably, preserve with the form that the website name-the Cookie value is right.
Step 3): during access websites, inquire about described configuration file afterwards, in the request header of webpage, insert the acquiescence cookie information in the described request head, and the cookie information relevant with login.
Be specially, when access websites, inquire about described configuration file, with the cookie information in the request header be set among the CookieStore after the relevant cookie information of login merges.Load cookie information by described web object.
Step 4): during logining, dynamic refresh Cookie.
Dynamic refresh Cookie comprises dual mode, and the first is periodic refreshing, and the second is to refresh when obtaining the website service failure.The method that refreshes when wherein obtaining the website service failure does not repeat them here with identical described in the upper embodiment.

Claims (8)

1. a Cookie dynamic loading method is characterized in that, comprising:
Step 1): generate the different Cookie management strategies that is used for dynamic refresh Cookie for different websites;
Step 2): Cookie management strategy and corresponding website are associated, be kept in the configuration file;
Step 3): during access websites, inquire about described configuration file, according to the Cookie management strategy dynamic load Cookie of described website afterwards.
2. Cookie dynamic loading method according to claim 1 is characterized in that,
Described step 1) also comprises: during access websites, if Cookie is not set in the request header, then record the cookie information relevant with login that the website is returned first;
Described step 2) also comprises: be kept at accordingly described cookie information and described site information in the configuration file;
Described step 3) also comprises: during access websites, inquire about described configuration file afterwards, insert cookie information corresponding to described website in the request header of webpage.
3. Cookie dynamic loading method according to claim 1 is characterized in that,
Described step 1) also comprises: first during access websites, and the cookie information that the record website is returned, the described cookie information that returns comprises that next access need be loaded into the acquiescence cookie information in the request header, and the cookie information relevant with login;
Described step 2) also comprises: be stored in accordingly the described cookie information that returns and described website in the configuration file;
Described step 3) also comprises: during access websites, inquire about described configuration file afterwards, insert acquiescence cookie information in the described request head and the cookie information relevant with login in the request header of webpage.
4. each described Cookie dynamic loading method is characterized in that according to claim 1-3, and dynamic load Cookie comprises and regularly refreshes Cookie.
5. each described Cookie dynamic loading method is characterized in that according to claim 1-3, and dynamic load Cookie comprises:
Step 3-1): during page exception, the unusual page after extracting each website service and obtaining unsuccessfully, and the feature of this unusual page is kept in the configuration file;
Step 3-2): detect page status, unusual if the page occurs, with the feature of the unusual page with and configuration file in the page is identical unusually feature compare, if identical, then refresh Cookie.
6. Cookie dynamic loading method according to claim 1 is characterized in that, a website and corresponding cookie information thereof are kept in the configuration file.
7. Cookie dynamic loading method according to claim 1 and 2, it is characterized in that, described step 3) also comprises: inquire about described configuration file, cookie information is write among the web object CookieStore, load cookie information by described web object.
8. Cookie dynamic loading method according to claim 3, it is characterized in that, described step 3) also comprises: inquire about described configuration file, with the acquiescence cookie information in the request header be set among the web object CookieStore after the relevant cookie information of login merges, load cookie information by described web object.
CN201310303159.6A 2013-07-18 2013-07-18 A kind of Cookie dynamic loading method Active CN103368964B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310303159.6A CN103368964B (en) 2013-07-18 2013-07-18 A kind of Cookie dynamic loading method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310303159.6A CN103368964B (en) 2013-07-18 2013-07-18 A kind of Cookie dynamic loading method

Publications (2)

Publication Number Publication Date
CN103368964A true CN103368964A (en) 2013-10-23
CN103368964B CN103368964B (en) 2016-04-06

Family

ID=49369501

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310303159.6A Active CN103368964B (en) 2013-07-18 2013-07-18 A kind of Cookie dynamic loading method

Country Status (1)

Country Link
CN (1) CN103368964B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106649719A (en) * 2016-12-22 2017-05-10 北京览群智数据科技有限责任公司 Page downloading method and client
CN106982226A (en) * 2017-04-27 2017-07-25 成都奇鲁科技有限公司 Automatic logging method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101242307A (en) * 2008-02-01 2008-08-13 刘峰 Website access analysis system and method based on built-in code proxy log
CN101505247A (en) * 2009-03-09 2009-08-12 成都市华为赛门铁克科技有限公司 Detection method and apparatus for number of shared access hosts
CN103179134A (en) * 2013-04-19 2013-06-26 中国建设银行股份有限公司 Single sign on method and system based on Cookie and application server thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101242307A (en) * 2008-02-01 2008-08-13 刘峰 Website access analysis system and method based on built-in code proxy log
CN101505247A (en) * 2009-03-09 2009-08-12 成都市华为赛门铁克科技有限公司 Detection method and apparatus for number of shared access hosts
CN103179134A (en) * 2013-04-19 2013-06-26 中国建设银行股份有限公司 Single sign on method and system based on Cookie and application server thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
夏晔: ""基于网站分类的网络用户隐私信息保护模型"", 《中国优秀硕士学位论文全文数据库(信息科技辑)》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106649719A (en) * 2016-12-22 2017-05-10 北京览群智数据科技有限责任公司 Page downloading method and client
CN106982226A (en) * 2017-04-27 2017-07-25 成都奇鲁科技有限公司 Automatic logging method and device

Also Published As

Publication number Publication date
CN103368964B (en) 2016-04-06

Similar Documents

Publication Publication Date Title
WO2012086920A3 (en) Distributed storage system having content-based overlap prevention function, method for storing object thereof, and storage medium readable by computer
CN106933854B (en) Short link processing method and device and server
CN108683679B (en) Multi-account login method, device, equipment and storage medium of Web APP
CN105718455A (en) Data query method and apparatus
CN109446160A (en) A kind of file reading, system, device and computer readable storage medium
US11632433B2 (en) System and method for improved opt-out recognition for a mobile device
CN104519008A (en) Cross-site scripting attack defense method and device and application server
SG11201901608VA (en) Method for accessing distributed storage system, related apparatus, and related system
CN110147410B (en) Data verification method, system, device and equipment in block chain type account book
CN104756596A (en) Intelligent homescreen for mobile devices
CN102801713A (en) Website logging-in method and system as well as accessing management platform
ES2818588T3 (en) Method and device to prevent the server from being attacked
CN104008158A (en) Data verification method, verification device and mobile terminal
CN103108033B (en) File uploading method and system
CN103973503A (en) Method and system for controlling mobile application permission
CN105516055A (en) Data access method, data access device, target device, and management server
CN104346410B (en) Monitoring method and device for terminal device
CN102769629B (en) Client-side password storage method and service system
CN103490978A (en) Terminal, server and message monitoring method
US20140157383A1 (en) Access management system and method
CN104580237A (en) Method for logging into website, server used in method for logging into website, client terminal used in method for logging into website and peripheral used in method for logging into website
CN103327036A (en) Identification method of Internet browsing devices and Cookie server
CN103368964A (en) Cookie dynamic loading method
CN104065674A (en) Terminal device and information processing method
CN105873180B (en) Method and apparatus for setting up wireless connection

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant