Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Query string
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Tracking == A program receiving a query string can ignore part or all of it. If the requested URL corresponds to a file and not to a program, the whole query string is ignored. However, regardless of whether the query string is used or not, the whole URL including it is stored in the server [[computer data logging|log files]]. These facts allow query strings to be used to track users in a manner similar to that provided by [[HTTP cookie]]s. For this to work, every time the user downloads a page, a unique identifier must be chosen and added as a query string to the URLs of all links the page contains. As soon as the user follows one of these links, the corresponding URL is requested to the server. This way, the download of this page is linked with the previous one. For example, when a web page containing the following is requested: <syntaxhighlight lang="html"> <a href="foo.html">see my page!</a> <a href="bar.html">mine is better</a> </syntaxhighlight> a unique string, such as <code>e0a72cb2a2c7</code> is chosen, and the page is modified as follows: <syntaxhighlight lang="html"> <a href="foo.html?e0a72cb2a2c7">see my page!</a> <a href="bar.html?e0a72cb2a2c7">mine is better</a> </syntaxhighlight> The addition of the query string does not change the way the page is shown to the user. When the user follows, for example, the first link, the browser requests the page <code>foo.html?e0a72cb2a2c7</code> to the server, which ignores what follows <code>?</code> and sends the page <code>foo.html</code> as expected, adding the query string to its links as well. This way, any subsequent page request from this user will carry the same query string <code>e0a72cb2a2c7</code>, making it possible to establish that all these pages have been viewed by the same user. Query strings are often used in association with [[web beacon]]s. The main differences between query strings used for tracking and HTTP cookies are that: # Query strings form part of the URL, and are therefore included if the user saves or sends the URL to another user; cookies can be maintained across browsing sessions, but are not saved or sent with the URL. # If the user arrives at the same web server by two (or more) independent paths, it will be assigned two different query strings, while the stored cookies are the same. # The user can disable cookies, in which case using cookies for tracking does not work. However, using query strings for tracking should work in all situations. # Different query strings passed by different visits to the page will mean that the pages are never served from the browser (or proxy, if present) cache thereby increasing the load on the web server and slowing down the user experience.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)