<s>
A	O
query	B-Protocol
string	I-Protocol
is	O
a	O
part	O
of	O
a	O
uniform	O
resource	O
locator	O
(	O
URL	O
)	O
that	O
assigns	O
values	O
to	O
specified	O
parameters	O
.	O
</s>
<s>
A	O
query	B-Protocol
string	I-Protocol
commonly	O
includes	O
fields	O
added	O
to	O
a	O
base	O
URL	O
by	O
a	O
Web	O
browser	O
or	O
other	O
client	O
application	O
,	O
for	O
example	O
as	O
part	O
of	O
an	O
HTML	B-Language
document	O
,	O
choosing	O
the	O
appearance	O
of	O
a	O
page	O
,	O
or	O
jumping	O
to	O
positions	O
in	O
multimedia	O
content	O
.	O
</s>
<s>
A	O
web	B-Application
server	I-Application
can	O
handle	O
a	O
Hypertext	B-Protocol
Transfer	I-Protocol
Protocol	I-Protocol
(	O
HTTP	B-Protocol
)	O
request	O
either	O
by	O
reading	O
a	O
file	O
from	O
its	O
file	B-Application
system	I-Application
based	O
on	O
the	O
URL	O
path	O
or	O
by	O
handling	O
the	O
request	O
using	O
logic	O
that	O
is	O
specific	O
to	O
the	O
type	O
of	O
resource	O
.	O
</s>
<s>
In	O
cases	O
where	O
special	O
logic	O
is	O
invoked	O
,	O
the	O
query	B-Protocol
string	I-Protocol
will	O
be	O
available	O
to	O
that	O
logic	O
for	O
use	O
in	O
its	O
processing	O
,	O
along	O
with	O
the	O
path	O
component	O
of	O
the	O
URL	O
.	O
</s>
<s>
A	O
typical	O
URL	O
containing	O
a	O
query	B-Protocol
string	I-Protocol
is	O
as	O
follows	O
:	O
</s>
<s>
When	O
a	O
server	B-Application
receives	O
a	O
request	O
for	O
such	O
a	O
page	O
,	O
it	O
may	O
run	O
a	O
program	O
,	O
passing	O
the	O
query	B-Protocol
string	I-Protocol
,	O
which	O
in	O
this	O
case	O
is	O
name	O
=	O
ferret	O
,	O
unchanged	O
to	O
the	O
program	O
.	O
</s>
<s>
The	O
question	O
mark	O
is	O
used	O
as	O
a	O
separator	O
,	O
and	O
is	O
not	O
part	O
of	O
the	O
query	B-Protocol
string	I-Protocol
.	O
</s>
<s>
Web	B-Application
frameworks	I-Application
may	O
provide	O
methods	O
for	O
parsing	O
multiple	O
parameters	O
in	O
the	O
query	B-Protocol
string	I-Protocol
,	O
separated	O
by	O
some	O
delimiter	O
.	O
</s>
<s>
The	O
exact	O
structure	O
of	O
the	O
query	B-Protocol
string	I-Protocol
is	O
not	O
standardized	O
.	O
</s>
<s>
Methods	O
used	O
to	O
parse	O
the	O
query	B-Protocol
string	I-Protocol
may	O
differ	O
between	O
websites	O
.	O
</s>
<s>
A	O
link	O
in	O
a	O
web	O
page	O
may	O
have	O
a	O
URL	O
that	O
contains	O
a	O
query	B-Protocol
string	I-Protocol
.	O
</s>
<s>
HTML	B-Language
defines	O
three	O
ways	O
a	O
user	O
agent	O
can	O
generate	O
the	O
query	B-Protocol
string	I-Protocol
:	O
</s>
<s>
One	O
of	O
the	O
original	O
uses	O
was	O
to	O
contain	O
the	O
content	O
of	O
an	O
HTML	B-General_Concept
form	I-General_Concept
,	O
also	O
known	O
as	O
web	B-General_Concept
form	I-General_Concept
.	O
</s>
<s>
In	O
particular	O
,	O
when	O
a	O
form	B-General_Concept
containing	O
the	O
fields	O
field1	O
,	O
field2	O
,	O
field3	O
is	O
submitted	O
,	O
the	O
content	O
of	O
the	O
fields	O
is	O
encoded	O
as	O
a	O
query	B-Protocol
string	I-Protocol
as	O
follows	O
:	O
</s>
<s>
The	O
query	B-Protocol
string	I-Protocol
is	O
composed	O
of	O
a	O
series	O
of	O
field-value	O
pairs	O
.	O
</s>
<s>
Within	O
each	O
pair	O
,	O
the	O
field	B-Application
name	O
and	O
value	O
are	O
separated	O
by	O
an	O
equals	O
sign	O
,	O
"	O
=	O
"	O
.	O
</s>
<s>
While	O
there	O
is	O
no	O
definitive	O
standard	O
,	O
most	O
web	B-Application
frameworks	I-Application
allow	O
multiple	O
values	O
to	O
be	O
associated	O
with	O
a	O
single	O
field	B-Application
(	O
e.g.	O
</s>
<s>
For	O
each	O
field	B-Application
of	O
the	O
form	B-General_Concept
,	O
the	O
query	B-Protocol
string	I-Protocol
contains	O
a	O
pair	O
field	B-Application
=	O
value	O
.	O
</s>
<s>
Web	B-General_Concept
forms	I-General_Concept
may	O
include	O
fields	O
that	O
are	O
not	O
visible	O
to	O
the	O
user	O
;	O
these	O
fields	O
are	O
included	O
in	O
the	O
query	B-Protocol
string	I-Protocol
when	O
the	O
form	B-General_Concept
is	O
submitted	O
.	O
</s>
<s>
In	O
the	O
recommendations	O
of	O
1999	O
,	O
W3C	O
recommended	O
that	O
all	O
web	B-Application
servers	I-Application
support	O
semicolon	O
separators	O
in	O
addition	O
to	O
ampersand	O
separators	O
to	O
allow	O
application/x	O
-www-form-urlencoded	O
query	B-Protocol
strings	I-Protocol
in	O
URLs	O
within	O
HTML	B-Language
documents	O
without	O
having	O
to	O
entity	O
escape	O
ampersands	O
.	O
</s>
<s>
The	O
form	B-General_Concept
content	O
is	O
only	O
encoded	O
in	O
the	O
URL	O
's	O
query	B-Protocol
string	I-Protocol
when	O
the	O
form	B-General_Concept
submission	O
method	O
is	O
GET	O
.	O
</s>
<s>
The	O
same	O
encoding	O
is	O
used	O
by	O
default	O
when	O
the	O
submission	O
method	O
is	O
POST	B-Protocol
,	O
but	O
the	O
result	O
is	O
submitted	O
as	O
the	O
HTTP	B-Protocol
request	O
body	O
rather	O
than	O
being	O
included	O
in	O
a	O
modified	O
URL	O
.	O
</s>
<s>
Before	O
forms	B-General_Concept
were	O
added	O
to	O
HTML	B-Language
,	O
browsers	O
rendered	O
the	O
element	B-General_Concept
as	O
a	O
single-line	O
text-input	O
control	O
.	O
</s>
<s>
The	O
text	O
entered	O
into	O
this	O
control	O
was	O
sent	O
to	O
the	O
server	B-Application
as	O
a	O
query	B-Protocol
string	I-Protocol
addition	O
to	O
a	O
GET	O
request	O
for	O
the	O
base	O
URL	O
or	O
another	O
URL	O
specified	O
by	O
the	O
attribute	B-General_Concept
.	O
</s>
<s>
This	O
was	O
intended	O
to	O
allow	O
web	B-Application
servers	I-Application
to	O
use	O
the	O
provided	O
text	O
as	O
query	O
criteria	O
so	O
they	O
could	O
return	O
a	O
list	O
of	O
matching	O
pages	O
.	O
</s>
<s>
When	O
the	O
text	O
input	O
into	O
the	O
indexed	O
search	O
control	O
is	O
submitted	O
,	O
it	O
is	O
encoded	O
as	O
a	O
query	B-Protocol
string	I-Protocol
as	O
follows	O
:	O
</s>
<s>
The	O
query	B-Protocol
string	I-Protocol
is	O
composed	O
of	O
a	O
series	O
of	O
arguments	O
by	O
parsing	O
the	O
text	O
into	O
words	O
at	O
the	O
spaces	O
.	O
</s>
<s>
Though	O
the	O
element	B-General_Concept
is	O
deprecated	O
and	O
most	O
browsers	O
no	O
longer	O
support	O
or	O
render	O
it	O
,	O
there	O
are	O
still	O
some	O
vestiges	O
of	O
indexed	O
search	O
in	O
existence	O
.	O
</s>
<s>
Also	O
some	O
web	B-Application
servers	I-Application
supporting	O
CGI	B-Language
(	O
e.g.	O
,	O
Apache	B-Application
)	O
will	O
process	O
the	O
query	B-Protocol
string	I-Protocol
into	O
command	O
line	O
arguments	O
if	O
it	O
does	O
not	O
contain	O
an	O
equals	O
sign	O
,	O
'	O
=	O
'	O
(	O
as	O
per	O
section	O
4.4	O
of	O
CGI	B-Language
1.1	O
)	O
.	O
</s>
<s>
Some	O
CGI	B-Language
scripts	I-Language
still	O
depend	O
on	O
and	O
use	O
this	O
historic	O
behavior	O
for	O
URLs	O
embedded	O
in	O
HTML	B-Language
.	O
</s>
<s>
In	O
HTML	B-General_Concept
forms	I-General_Concept
,	O
the	O
character	O
=	O
is	O
used	O
to	O
separate	O
a	O
name	O
from	O
a	O
value	O
.	O
</s>
<s>
The	O
URI	O
generic	O
syntax	O
uses	O
URL	O
encoding	O
to	O
deal	O
with	O
this	O
problem	O
,	O
while	O
HTML	B-General_Concept
forms	I-General_Concept
make	O
some	O
additional	O
substitutions	O
rather	O
than	O
applying	O
percent	O
encoding	O
for	O
all	O
such	O
characters	O
.	O
</s>
<s>
HTML	B-Application
5	I-Application
specifies	O
the	O
following	O
transformation	O
for	O
submitting	O
HTML	B-General_Concept
forms	I-General_Concept
with	O
the	O
"	O
GET	O
"	O
method	O
to	O
a	O
web	B-Application
server	I-Application
.	O
</s>
<s>
The	O
octet	O
corresponding	O
to	O
the	O
tilde	O
("~"	O
)	O
is	O
permitted	O
in	O
query	B-Protocol
strings	I-Protocol
by	O
RFC3986	O
but	O
required	O
to	O
be	O
percent-encoded	O
in	O
HTML	B-General_Concept
forms	I-General_Concept
to	O
"	O
%7E	O
"	O
.	O
</s>
<s>
If	O
a	O
form	B-General_Concept
is	O
embedded	O
in	O
an	O
HTML	B-Language
page	O
as	O
follows	O
:	O
</s>
<s>
and	O
the	O
user	O
inserts	O
the	O
strings	O
“	O
this	O
is	O
a	O
field	B-Application
”	O
and	O
“	O
was	O
it	O
clear	O
(	O
already	O
)	O
?	O
”	O
in	O
the	O
two	O
text	O
fields	O
and	O
presses	O
the	O
submit	O
button	O
,	O
the	O
program	O
test.cgi	O
(	O
the	O
program	O
specified	O
by	O
the	O
action	O
attribute	B-General_Concept
of	O
the	O
form	B-General_Concept
element	B-General_Concept
in	O
the	O
above	O
example	O
)	O
will	O
receive	O
the	O
following	O
query	B-Protocol
string	I-Protocol
:	O
</s>
<s>
first	O
=	O
this+is+a+field&second	O
=	O
was+it+clear+%28already%29%3F	O
.	O
</s>
<s>
If	O
the	O
form	B-General_Concept
is	O
processed	O
on	O
the	O
server	B-Application
by	O
a	O
CGI	B-Language
script	I-Language
,	O
the	O
script	B-Language
may	O
typically	O
receive	O
the	O
query	B-Protocol
string	I-Protocol
as	O
an	O
environment	O
variable	O
named	O
QUERY_STRING	O
.	O
</s>
<s>
A	O
program	O
receiving	O
a	O
query	B-Protocol
string	I-Protocol
can	O
ignore	O
part	O
or	O
all	O
of	O
it	O
.	O
</s>
<s>
If	O
the	O
requested	O
URL	O
corresponds	O
to	O
a	O
file	O
and	O
not	O
to	O
a	O
program	O
,	O
the	O
whole	O
query	B-Protocol
string	I-Protocol
is	O
ignored	O
.	O
</s>
<s>
However	O
,	O
regardless	O
of	O
whether	O
the	O
query	B-Protocol
string	I-Protocol
is	O
used	O
or	O
not	O
,	O
the	O
whole	O
URL	O
including	O
it	O
is	O
stored	O
in	O
the	O
server	B-Application
log	B-Application
files	I-Application
.	O
</s>
<s>
These	O
facts	O
allow	O
query	B-Protocol
strings	I-Protocol
to	O
be	O
used	O
to	O
track	O
users	O
in	O
a	O
manner	O
similar	O
to	O
that	O
provided	O
by	O
HTTP	B-Application
cookies	I-Application
.	O
</s>
<s>
For	O
this	O
to	O
work	O
,	O
every	O
time	O
the	O
user	O
downloads	O
a	O
page	O
,	O
a	O
unique	O
identifier	O
must	O
be	O
chosen	O
and	O
added	O
as	O
a	O
query	B-Protocol
string	I-Protocol
to	O
the	O
URLs	O
of	O
all	O
links	O
the	O
page	O
contains	O
.	O
</s>
<s>
As	O
soon	O
as	O
the	O
user	O
follows	O
one	O
of	O
these	O
links	O
,	O
the	O
corresponding	O
URL	O
is	O
requested	O
to	O
the	O
server	B-Application
.	O
</s>
<s>
The	O
addition	O
of	O
the	O
query	B-Protocol
string	I-Protocol
does	O
not	O
change	O
the	O
way	O
the	O
page	O
is	O
shown	O
to	O
the	O
user	O
.	O
</s>
<s>
When	O
the	O
user	O
follows	O
,	O
for	O
example	O
,	O
the	O
first	O
link	O
,	O
the	O
browser	O
requests	O
the	O
page	O
foo.html	O
?	O
e0a72cb2a2c7	O
to	O
the	O
server	B-Application
,	O
which	O
ignores	O
what	O
follows	O
?	O
</s>
<s>
and	O
sends	O
the	O
page	O
foo.html	O
as	O
expected	O
,	O
adding	O
the	O
query	B-Protocol
string	I-Protocol
to	O
its	O
links	O
as	O
well	O
.	O
</s>
<s>
This	O
way	O
,	O
any	O
subsequent	O
page	O
request	O
from	O
this	O
user	O
will	O
carry	O
the	O
same	O
query	B-Protocol
string	I-Protocol
e0a72cb2a2c7	O
,	O
making	O
it	O
possible	O
to	O
establish	O
that	O
all	O
these	O
pages	O
have	O
been	O
viewed	O
by	O
the	O
same	O
user	O
.	O
</s>
<s>
Query	B-Protocol
strings	I-Protocol
are	O
often	O
used	O
in	O
association	O
with	O
web	B-Protocol
beacons	I-Protocol
.	O
</s>
<s>
The	O
main	O
differences	O
between	O
query	B-Protocol
strings	I-Protocol
used	O
for	O
tracking	O
and	O
HTTP	B-Application
cookies	I-Application
are	O
that	O
:	O
</s>
<s>
Query	B-Protocol
strings	I-Protocol
form	B-General_Concept
part	O
of	O
the	O
URL	O
,	O
and	O
are	O
therefore	O
included	O
if	O
the	O
user	O
saves	O
or	O
sends	O
the	O
URL	O
to	O
another	O
user	O
;	O
cookies	B-Application
can	O
be	O
maintained	O
across	O
browsing	O
sessions	O
,	O
but	O
are	O
not	O
saved	O
or	O
sent	O
with	O
the	O
URL	O
.	O
</s>
<s>
If	O
the	O
user	O
arrives	O
at	O
the	O
same	O
web	B-Application
server	I-Application
by	O
two	O
(	O
or	O
more	O
)	O
independent	O
paths	O
,	O
it	O
will	O
be	O
assigned	O
two	O
different	O
query	B-Protocol
strings	I-Protocol
,	O
while	O
the	O
stored	O
cookies	B-Application
are	O
the	O
same	O
.	O
</s>
<s>
The	O
user	O
can	O
disable	O
cookies	B-Application
,	O
in	O
which	O
case	O
using	O
cookies	B-Application
for	O
tracking	O
does	O
not	O
work	O
.	O
</s>
<s>
However	O
,	O
using	O
query	B-Protocol
strings	I-Protocol
for	O
tracking	O
should	O
work	O
in	O
all	O
situations	O
.	O
</s>
<s>
Different	O
query	B-Protocol
strings	I-Protocol
passed	O
by	O
different	O
visits	O
to	O
the	O
page	O
will	O
mean	O
that	O
the	O
pages	O
are	O
never	O
served	O
from	O
the	O
browser	O
(	O
or	O
proxy	O
,	O
if	O
present	O
)	O
cache	O
thereby	O
increasing	O
the	O
load	O
on	O
the	O
web	B-Application
server	I-Application
and	O
slowing	O
down	O
the	O
user	O
experience	O
.	O
</s>
<s>
According	O
to	O
the	O
HTTP	B-Protocol
specification	O
:	O
</s>
<s>
It	O
is	O
RECOMMENDED	O
that	O
all	O
HTTP	B-Protocol
senders	O
and	O
recipients	O
support	O
,	O
at	O
a	O
minimum	O
,	O
request-line	O
lengths	O
of	O
8000	O
octets.HTTP/1.1	O
Message	O
Syntax	O
and	O
Routing	O
.	O
</s>
<s>
If	O
the	O
URL	O
is	O
too	O
long	O
,	O
the	O
web	B-Application
server	I-Application
fails	O
with	O
the	O
414	O
Request-URI	O
Too	O
Long	O
HTTP	B-Protocol
status	O
code	O
.	O
</s>
<s>
The	O
common	O
workaround	O
for	O
these	O
problems	O
is	O
to	O
use	O
POST	B-Protocol
instead	O
of	O
GET	O
and	O
store	O
the	O
parameters	O
in	O
the	O
request	O
body	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
limit	O
on	O
POST	B-Protocol
size	O
,	O
by	O
default	O
,	O
is	O
2MB	O
on	O
IIS	O
4.0	O
and	O
128KB	O
on	O
IIS	O
5.0	O
.	O
</s>
<s>
The	O
limit	O
is	O
configurable	O
on	O
Apache2	B-Application
using	O
the	O
LimitRequestBody	O
directive	O
,	O
which	O
specifies	O
the	O
number	O
of	O
bytes	O
from	O
0	O
(	O
meaning	O
unlimited	O
)	O
to	O
2147483647	O
(	O
2GB	O
)	O
that	O
are	O
allowed	O
in	O
a	O
request	O
body	O
.	O
</s>
