Format and syntax Cookie

The specification


The full description of field Set-Cookie HTTP of heading:



Set-Cookie: NAME=VALUE; expires=DATE; path=PATH; domain=DOMAIN_NAME; secure


The minimal description of field Set-Cookie HTTP of heading:



Set-Cookie: NAME=VALUE;


NAME=VALUE - a line of symbols, excepting translation of a line, points and blanks. A NAME-name cookie, VALUE - value.


expires=DATE - a storage time cookie, i.e. instead of DATE there should be a date in format Wdy, DD-Mon-YYYY HH:MM:SS GMT after which the storage time cookie expires. If this attribute is not specified, cookie is stored{kept} during one session, before closing a browser.


domain=DOMAIN_NAME - the domain for which value cookie is valid. For example, domain=realcoding.net. In this case value cookie will be valid and for the server realcoding.net, and for www.realcoding.net. But be not pleased, the instruction{indication} of two last periods of domain names suffices only for domains of hierarchy "COM", "EDU", "NET", "ORG", "GOV", "MIL", and "INT". For domains of hierarchy "RU" it is necessary to specify three periods.


If this attribute is lowered{omitted}, the domain name of the server from which value cookie has been exposed is by default used.


path=PATH - this attribute establishes a subset of documents for which it is valid znachanie cookie. For example, the instruction{indication} path =/win will lead to to that value cookie will be valid for set of documents in a directory/win/, in a directory/wings/and files in the current directory with names such as wind.html and windows.shtml


If this attribute is not specified, value cookie is distributed only to documents in the same directory, as the document in which it has been established cookie.


secure - if there is such marker the information cookie is sent only through HTTPS (HTTP with use SSL). If this marker is not specified, the information is sent by usual way.

Syntax HTTP of heading for field Cookie


When the document with HTTP the server is requested, the browser checks the cookie for conformity to the domain of the server and the other information. In case values satisfying all conditions cookie a browser are found sends them in the server as pair name / value:



Cookie: NAME1=OPAQUE_STRING1; NAME2=OPAQUE_STRING2...



Additional data


In case cookie accepts new value at available already in a browser cookie with conterminous NAME, domain and path, old value zatiraetsja new. In other cases new cookies are added.


Use expires does not guarantee safety cookie during the set period of time as the client (browser) can remove recording owing to shortage of the selected place or any other limits.


The client (browser) has the following restrictions:


* In total it can be stored{kept} up to 300 values cookies

* Everyone cookie cannot exceed 4Kbajt

* From one server or the domain it can be stored{kept} up to 20 values cookie


If restriction 300 or 20 is exceeded, the first recording on time leaves. At excess 4K - the correctness such cookie suffers - otrezaetsja a piece of recording (from the beginning of this recording) equal to excess.


In case of caching documents, for example, the proxy-server, field Set-cookie HTTP of heading never kehshiruetsja.


If the proxy-server accepts the answer containing field Set-cookie in heading, it is supposed, that the field taki reaches the client without dependence from the status 304 (Not Modified) or 200 (OK).


Accordingly, if the client search contains in heading Cookie he should reach the server even if it is established If-modified-since.


I believe, that all that is said about proxy does not concern to a case when cookie it is established rigidly with help META-tagov.


Examples


Some examples, illjustrirujuhhikh use cookies are below resulted


The first example:


The client requests the document and accepts the answer:



Set-Cookie: CUSTOMER=WILE_E_COYOTE; path =/; expires=Wednesday, 09-Nov-99 23:12:40 GMT


When the client requests URL with a way "/" on this server, he sends:



Cookie: CUSTOMER=WILE_E_COYOTE


The client requests the document and accepts the answer:



Set-Cookie: PART_NUMBER=ROCKET_LAUNCHER_0001; path =/


When the client requests URL with a way "/" on this server, he sends:



Cookie: CUSTOMER=WILE_E_COYOTE; PART_NUMBER=ROCKET_LAUNCHER_0001


The client receives:



Set-Cookie: SHIPPING=FEDEX; path =/foo


When the client requests URL with a way "/" on this server, he sends:



Cookie: CUSTOMER=WILE_E_COYOTE; PART_NUMBER=ROCKET_LAUNCHER_0001


When the client requests URL with a way "/foo" on this server, he sends:



Cookie: CUSTOMER=WILE_E_COYOTE; PART_NUMBER=ROCKET_LAUNCHER_0001; SHIPPING=FEDEX


The second example:


The client accepts:



Set-Cookie: PART_NUMBER=ROCKET_LAUNCHER_0001; path =/


When the client requests URL with a way "/" on this server, he sends:



Cookie: PART_NUMBER=ROCKET_LAUNCHER_0001


The client accepts:



Set-Cookie: PART_NUMBER=RIDING_ROCKET_0023; path =/ammo


When the client requests URL with a way "/ammo" on this server, he sends:



Cookie: PART_NUMBER=RIDING_ROCKET_0023; PART_NUMBER=ROCKET_LAUNCHER_0001


The comment: here we have two pairs name / value with a name "PART_NUMBER". This heritage from the previous example where value for a way "/" has increased to value for "/ammo".


Strategy of increase of reference popularity for achievement of high positions in search engines

For many the idea of optimization of a site in search engines is settled{exhausted} by job with meta-tags and headings. Once it was enough. Unfortunately optimizatorov and fortunately users of search engines of a rule have changed.


Today is more than 80 factors influencing ranging of a site. Everything, from headings and meta-tags up to the maintenance{contents} and ALT-tags, is taken into account in ranging a site.


Recent clause{article} " A Ten Minute Search Engine Optimization " http://www.searchengineguide.com/dunn/2003/0421_rd1.html Ross Dann (Ross Dunn), executive director " StepForth Search Engine Placement " has devoted to bases of present search optimization.


Clause{Article} shines{covers} set of internal factors in delivery of a site, and also mentions a question on the importance of external links. Links to a site not the most important element at ranzhirovani, but, with other things being equal, external links can play a main role positions of a site.