Lecture 4: Cookies

?

1. Which of these is NOT a typical scenario for cookies?

  • Specific Tracker - Amazon's personal recommendations.
  • Behaviour Tracker - Netmarketing, Google's Adsense.
  • Kitchen Cupboard - Marylands, Fox's, Hobnobs.
  • Small Widgets - View counters, last visit trackers, shopping carts.
1 of 10

Other questions in this quiz

2. Is HTTP Stateless?

  • Yes - HTTP is stateless. This means that web servers don't have the memory of the status of a connection so every connection will be considered as a fresh connection by the server.
  • No - HTTP is not stateless. This means that web servers don't have the memory of the status of a connection so every connection will be considered as a fresh connection by the server.

3. CRUD Logic & PHP Functionality for Read

  • Logic: Read the value from the cookie. PHP Functionality: $_COOKIE[].
  • Logic: Set a cookie with name, value & expiry time & instruct the web browser to create it. PHP Function: setcookie() or setrawcookie()
  • Logic: Set a new cookie with the same name and new value and/or expiry time to "override" the existing cookie. PHP Functionality: setcookie() or setrawcookie()

4. Which is not the Working Logic of a Cookie?

  • https://imgur.com/a/bulGyAu - This is an image of the components of a cookie.
  • When the client communicates with the web server for the first time, the web server sets the content of a cookie (e.g., the value and expiry date) and instructs the user agent (Web Browser) to create the cookie for the client.
  • When it communicates with the web server next time: The server will be able to check the cookie to identify the client through the user agent.

5. CRUD Logic & PHP Functionality for Create

  • Logic: Read the value from the cookie. PHP Function: $_COOKIE[].
  • Logic: Set a cookie with name, value & expiry time & instruct the web browser to create it. PHP Function: setcookie() or setrawcookie()
  • Logic: Set a new cookie with the same name and new value and/or expiry time to "override" the existing cookie. PHP Functionality: setcookie() or setrawcookie()

Comments

No comments have yet been made

Similar Computing resources:

See all Computing resources »See all Web Technology Integration resources »