Home > Technology > Cookies demystified

Cookies demystified


 

Http is a connection oriented protocol but it is stateless protocol. In http connection is closed as soon as website is loaded. In order to maintain state we require some other mechanism there are three different mechanisms 1) cookie 2) URL writing 3) Hidden fields

Cookies:

Cookie is a small information stored in a file on client machine. It is mainly used to store session information or user preferences

Browser manages the cookie, if a website sends cookie information as a part of response then browser stores it in a cookie file and whenever user is making a request for a page on that website browser automatically sends cookie as a part of request.

Cookie created by one website cannot be accessed by other website(Conventionally without reply XSS or some other attack). The size of cookie file is 4KB. If a file is full then new file is created for a website.

Every website can have at most 20 cookie files.

Cookies have expiry time and they are invalid after expiry time.

Cookies can be accessed using java script, jsp or servlets, asp, java etc.,

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: