tags:

views:

80

answers:

5

Hi I like to know What the content is stored in in cookies? Who will fix that content

+2  A: 

A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, you can both create and retrieve cookie values.

Link - cookies

Explanation from the php.net:

PHP transparently supports HTTP cookies. Cookies are a mechanism for storing data in the remote browser and thus tracking or identifying return users. Cookies are part of the HTTP header, so setcookie() must be called before any output is sent to the browser.

Alex
A: 

Cookie contents are arbitrary, each application developer can choose to put any information they wish in a cookie. Cookies will usually be quite small and often contain little more than a session id: a key to larger session state held my a server. The browser needs to know nothing about the contents, it just needs to send the cookie back on the next request.

djna
A: 

The content of a cookie is nothing more that a small piece of text. The meaning of the text can be anything. It depends on the software the website is using what it means.

Often it is used to store a unique identifier for a user so that a statefull connection can be established between the browser and webserver.

In other cases cookies are used to store authentication information (username and a crypto hash) to that users are automatically logged in when they reconnect to a site (like stackoverflow does).

elmuerte
A: 

A cookie is nothing but a small text file that's stored in your browser. contains some data:

-A name-value pair containing the actual data

-An expiry date after which it is no longer valid

-The domain and path of the server it should be sent to

Click here for more details

peacmaker
A: 

A cookie is a little piece of text send by a http server to a client. The client may ignore or store the cookie. If stored, the client should store information about the server (host, secure, cookie livetime, ...) as well. When sending a new request to the same server, the cookie may also send by the client to the server.

Typical contents are login information, language settings or session id to provide a statefull communication. Normally only the server creates/changes the cookie value, the client may ignore the cookie or delete it if dated out. The content is encrypted sometimes so the client cannot change it.

Arne Burmeister