HTTP and Cookies Flashcards

1
Q

What is a HTTP cookie (also called web cookie, Internet cookie, browser cookie or simply cookie)?

A

It is a small piece of PLAIN TEXT data sent from a website and stored onto the user’s computer by the user’s web browser while the user is web browsing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Cookie for?

A

Cookies were designed to be a reliable mechanism for websites to remember stateful information. When the user visits a website’s login page, the web server typically sends the client a cookie containing a unique session identifier.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a Sessions Cookie?

A

It is a cookie that exists only in temporary memory while the user navigates the website. It gets deleted when the user close the browser. Does not have expiration date.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to Set a cookie?

A

Cookies are set using the Set-Cookie HTTP header, sent in an HTTP response from the web server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a state

A

State is variables, information being saved and preserved by a class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the difference between HTTP GET and HTTP POST?

A

“GET” is for retrieving data whereas “POST” may involve anything, like storing or updating data, or ordering a product, or sending E-mail. GET is known as an “idempotent” request, meaning that it should make no lasting effect on the state of the server.
GET requests can be cached,
GET requests remain in the browser history,
GET requests can be bookmarked,
GET requests should never be used when dealing with sensitive data,
GET requests have length restrictions,
GET requests should be used only to retrieve data,
GET requests place the parameters in the request header.
POST requests are never cached,
POST requests do not remain in the browser history, POST requests cannot be bookmarked,
POST requests have no restrictions on data length, POST requests place the parameters in the message body.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly