Cookies

Ace your homework & exams now with Quizwiz!

What are third party cookies?

A third party cookie is used by advertising companies to promote traffic to their website. A piece of code is put on one website so that it can be used on the web.

Define a cookie and describe why they are useful.

An HTTP cookie (web cookie, browser cookie) is a small piece of data that a server sends to the user's web browser. The browser may store it and send it back with the next request to the same server. Typically, it's used to tell if two requests came from the same browser — keeping a user logged-in, for example. It remembers stateful information for the stateless HTTP protocol.

Since HTTP is stateless, how is state preserved across requests?

HTTP is a stateless (or non-persistent) protocol. Each request is treated by its own. A request will not know what was done in the previous requests. The protocol is designed to be stateless for simplicity. However, some Internet applications, such as e-commerce shopping cart, require the state information to be passed one request to the next. Since the protocol is stateless, it is the responsibility of the application to maintain state information within their application. Cookies can be used to preserve state information across multiple HTTP requests.

If you do not set an expires parameter when will your cookie expire?

If not specified, the cookie will have the lifetime of a session cookie. A session is finished when the client is shut down meaning that session cookies will get removed.

What data type does request.cookies.get() return?

Request.cookies.get() returns a string.

Can you set a cookie for a different domain?

You cannot set cookies for another domain. Allowing this would present an enormous security flaw.


Related study sets

Old Testament Survey: Final Exam Study Guide First Edition

View Set

prepu management of pts with neurologic trauma.😊

View Set

Xoa's Life Insurance Practice exam

View Set