CN103368964B - A kind of Cookie dynamic loading method - Google Patents

A kind of Cookie dynamic loading method Download PDF

Info

Publication number
CN103368964B
CN103368964B CN201310303159.6A CN201310303159A CN103368964B CN 103368964 B CN103368964 B CN 103368964B CN 201310303159 A CN201310303159 A CN 201310303159A CN 103368964 B CN103368964 B CN 103368964B
Authority
CN
China
Prior art keywords
cookie
configuration file
website
cookie information
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.)
Active
Application number
CN201310303159.6A
Other languages
Chinese (zh)
Other versions
CN103368964A (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

Abstract

A kind of Cookie dynamic loading method, comprising: step 1): generate the different Cookie management strategies for dynamic refresh Cookie for different websites; Step 2): Cookie management strategy and corresponding website are associated, is kept in configuration file; Step 3): afterwards during access websites, inquires about described configuration file, according to the Cookie management strategy dynamic load Cookie of described website.The invention enables user to log in by refreshing Cookie after logging in first, and keep logging status by refreshing Cookie after login.

Description

A kind of Cookie dynamic loading method
Technical field
The present invention relates to web application technology, more specifically, relate to Cookie dynamic loading method.
Background technology
There is different login modes different websites, and generally when logging in first, website can return browser cookie information, is stored in this locality.During user's access websites next time, registered user's whether Website login can be judged.User may be pointed out: whether upper once enter this website time retain user profile to simplify and log in formality.But even if there has been Cookie, some websites also want user's input validation code to carry out authentication, which increase the consistency that user logs in.Another situation is, certain page of website occurs abnormal, causes service to provide failure,
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 for dynamic refresh Cookie for different websites; Step 2): Cookie management strategy and corresponding website are associated, is kept in configuration file; Step 3): afterwards during access websites, inquires about described configuration file, according to the Cookie management strategy dynamic load Cookie of described website.
The present invention can simplify the operation of user's Website login, user is logged in by refreshing Cookie after logging in first, and keeps logging status by refreshing Cookie after login.
Accompanying drawing explanation
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
As shown in Figure 1-2, inventive method of the present invention comprises:
Step 1): generate the different Cookie management strategies for dynamic refresh Cookie for different websites.
Step 2): Cookie management strategy and corresponding website are associated, is kept in configuration file.
More specifically, Cookie management strategy saves, and account should log in relevant cookie information with this account after logging in, and the information of how dynamic refresh Cookie.In addition, the cookie information preserved in configuration file is corresponding with website, associates uniquely mutually.
Step 3): afterwards during access websites, inquires about described configuration file, according to the Cookie management strategy dynamic load Cookie of described website.
Wherein, during loading Cookie, cookie information used has been kept in configuration file.Dynamic load comprises dynamic refresh Cookie, and refresh time can preset or dynamically set, such as, refresh once every half an hour.
Dynamic refresh Cookie, except periodic refreshing, refreshes when being also included in page exception.During page exception, usual webpage comprises a string character string, such as " server hurries, and please tries after a while again ".Character string can be extracted from the abnormal page, is used for distinguishing the normal page and the abnormal page.The feature of the different website abnormal pages is different.Website service is obtained and unsuccessfully can be judged by the state of the page, and after page exception, account cannot normal request data, and 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, extract each website service and obtain the abnormal page unsuccessfully, and the feature of this abnormal page is kept in configuration file.
Step 3-2): after login, detect page status, if the page occurs abnormal, the feature of the abnormal page is compared with the feature identical with the abnormal page in configuration file, if identical, the Cookie management strategy then loading this website completes the dynamic refresh of Cookie, thus makes the page remain logging status.
In an embodiment of Cookie dynamic loading method of the present invention, This embodiment describes another kind of situation: in request header, Cookie is not set.This Cookie dynamic loading method comprises:
Step 1): first during access websites, if do not arrange Cookie in request header, then records the cookie information relevant with login that website returns, described cookie information and described site information is kept at accordingly in configuration file.
Preferably, preserve with the form that website name-cookie information is right in configuration file.
Alternatively, the cookie information of a website and correspondence thereof is kept in a configuration file.
Step 2): afterwards during access websites, inquire about described configuration file, in the request header of webpage, insert cookie information corresponding to described website.
Now, cookie information has been kept in described configuration file, can read and log in relevant cookie information from described configuration file.Namely, log in by refreshing cookie information, and do not need user again to input such as username and password to log in.
Further, when access websites, inquire about described configuration file, cookie information is write in web object CookieStore, load cookie information by described web object.
Step 3): during logging in, dynamic refresh Cookie.
Dynamic refresh Cookie comprises two kinds of modes, and the first is periodic refreshing, and the second refreshes when obtaining website service failure.
When obtaining website service failure, dynamic refresh Cookie comprises:
Step 3-1): extract each website service and obtain the abnormal page unsuccessfully, and the feature of this abnormal page is kept in configuration file.
During page exception, usual webpage comprises a string character string, such as " server hurries, and please tries after a while again ".Character string can be extracted from the abnormal page, is used for distinguishing the normal page and the abnormal page.The feature of the different website abnormal pages is different.
Website service is obtained and unsuccessfully can be judged by the state of the page, and after page exception, account cannot normal request data, and website has abnormal prompt, just can detect whether service acquisition failure by these special pages.
Step 3-2): detect page status, if the page occurs abnormal, the feature of the abnormal page is compared with the feature identical with the abnormal page in configuration file, if identical, then dynamic refresh Cookie, thus make the page remain logging status.
In the another embodiment of Cookie dynamic loading method of the present invention, This embodiment describes another kind of situation: in request header, be provided with Cookie.
If be provided with Cookie in request header, during each access destination website, request header can bring this cookie information automatically.Http request header gives tacit consent to the cookie information carried, and general just some basic information, such as area, id, expired time etc., do not relate to and log in 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 returns of record website, described in the cookie information that returns comprise and access the acquiescence cookie information that need be loaded in request header next time, and with log in relevant cookie information.
Step 2): the described cookie information that returns and described website are stored in configuration file accordingly.
Preferably, be worth right form with website name-Cookie to preserve.
Step 3): afterwards during access websites, inquires about described configuration file, inserts the acquiescence cookie information in described request head in the request header of webpage, and the cookie information relevant with login.
Be specially, when access websites, inquire about described configuration file, be set in CookieStore after the cookie information in request header and the cookie information relevant with login are merged.Cookie information is loaded by described web object.
Step 4): during logging in, dynamic refresh Cookie.
Dynamic refresh Cookie comprises two kinds of modes, and the first is periodic refreshing, and the second refreshes when obtaining website service failure.The method refreshed when wherein obtaining website service failure is identical with described in a upper embodiment, does not repeat them here.

Claims (7)

1. a Cookie dynamic loading method, is characterized in that, comprising:
Step 1): generate the different Cookie management strategies for dynamic refresh Cookie for different websites;
Step 2): Cookie management strategy and corresponding website are associated, is kept in configuration file;
Step 3): afterwards during access websites, inquire about described configuration file, according to the Cookie management strategy dynamic load Cookie of described website; Wherein,
Described dynamic load Cookie comprises:
Step 3-1): during page exception, extract each website service and obtain the abnormal page unsuccessfully, and the feature of this abnormal page is kept in configuration file;
Step 3-2): detect page status, if the page occurs abnormal, the feature of the abnormal page is compared with the feature identical with the abnormal page in configuration file, if identical, then refreshes Cookie.
2. Cookie dynamic loading method according to claim 1, is characterized in that,
Described step 1) also comprise: first during access websites, if do not arrange Cookie in request header, then record the cookie information relevant with login that website returns;
Described step 2) also comprise: described cookie information and described site information are kept in configuration file accordingly;
Described step 3) also comprise: afterwards during access websites, inquire about described configuration file, in the request header of webpage, insert cookie information corresponding to described website.
3. Cookie dynamic loading method according to claim 1, is characterized in that,
Described step 1) also comprise: first during access websites, the cookie information that returns of record website, described in the cookie information that returns comprise and access the acquiescence cookie information that need be loaded in request header next time, and with log in relevant cookie information;
Described step 2) also comprise: the described cookie information that returns and described website are stored in configuration file accordingly;
Described step 3) also comprise: afterwards during access websites, inquire about described configuration file, in the request header of webpage, insert the acquiescence cookie information in described request head and the cookie information relevant with login.
4. the Cookie dynamic loading method according to any one of claim 1-3, is characterized in that, dynamic load Cookie comprises and regularly refreshes Cookie.
5. Cookie dynamic loading method according to claim 1, is characterized in that, the cookie information of a website and correspondence thereof is kept in a configuration file.
6. Cookie dynamic loading method according to claim 1 and 2, it is characterized in that, described step 3) also comprise: inquire about described configuration file, cookie information is write in web object CookieStore, load cookie information by described web object.
7. Cookie dynamic loading method according to claim 3, it is characterized in that, described step 3) also comprise: inquire about described configuration file, be set in web object CookieStore after acquiescence cookie information in request header and the cookie information relevant with login are merged, 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 CN103368964A (en) 2013-10-23
CN103368964B true 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)

Families Citing this family (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
CN106982226B (en) * 2017-04-27 2020-08-14 成都安易迅科技有限公司 Automatic login 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
"基于网站分类的网络用户隐私信息保护模型";夏晔;《中国优秀硕士学位论文全文数据库(信息科技辑)》;20130315(第3期);I139-298 *

Also Published As

Publication number Publication date
CN103368964A (en) 2013-10-23

Similar Documents

Publication Publication Date Title
US11411928B2 (en) Mobile device identification using second entity matching
WO2012086920A3 (en) Distributed storage system having content-based overlap prevention function, method for storing object thereof, and storage medium readable by computer
CN102137174B (en) Method for caching of domain name system, authorized domain name server and cache domain name server
US20150127943A1 (en) Method for implementing cross-domain jump, browser, and domain name server
US11632433B2 (en) System and method for improved opt-out recognition for a mobile device
CN104636392A (en) Method and system for issuing recommending information, server and browser
ES2818588T3 (en) Method and device to prevent the server from being attacked
Li et al. Demand uncertainty reduction in decentralized supply chains
FI20070416L (en) Management system
US20120317620A1 (en) Website visitor identification algorithm
CN102739678A (en) Single sign-on processing system and single sign-on processing method
CN103368964B (en) A kind of Cookie dynamic loading method
CN103327036B (en) The identification method of internet browsing equipment and Cookie server
US20170094030A1 (en) Method In A Client-Server Network And Client-Server Network
CN105472029A (en) Single sign-on method and system based on cache
Beck et al. Cosmopolitanism and cosmopolitanization
Chen An Introduction to Statistics
Campbell Management by objectives
Wright et al. Scatterplot matrices
Monnet Pressuremeter Tests (PMT, SBP) and Variants
CN117370951A (en) Password verification method and system with timing failure and dynamic change
Aberasturi Violin Plot
CN116305020A (en) Resource access method, system, electronic device and computer readable storage medium
Hubbard New Measurement Instruments for Management
Bean Keeping It (Hyper) Real: Anchoring in the Age of Fake News

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