Lecture 9: Sessions

?

1. What is the working logic & PHP function for Update (CRUD)?

  • Logic: Update session variables which have been set. PHP Function: $_SESSION[].
  • Logic: Enable session support for a script. Set session variables. PHP Function: $_SESSION[].
  • Logic: Read session variables which have been set. PHP Function: $_SESSION[].
  • Logic: Destroy/Unset Sessions. PHP Function: session_destroy() or unset().
1 of 12

Other questions in this quiz

2. What is the 'second' step of the Session Working Logic?

  • PHP app server writes the corresponding session data to the environment as a server-side cookie. (Happens alongside to the first step)
  • PHP App server will allocate unique session ids for clients. This is saved as a client-side session cookie.
  • Each time when a session id is picked up, the corresponding data will be loaded.

3. Which of these does not describe a session?

  • When a bunch of people get together, smoke, drink and generally have a great time.
  • A session is an essential component of communication protocols, e.g., the 5th layer in the OSI model.
  • It is a semi-permanent dialogue between two communicating parties, which is used to store and exchange information. Example: When you log into Gmail, you are automatically logged into Google Docs etc.
  • PHP Sessions are a web app specific state management solution to the stateless HTTP (Enables more customisable and user friendly applications to be built).

4. What is the working logic & PHP function required for all CRUD operations to work?

  • Logic: Read session variables which have been set. PHP Function: $_SESSION[].
  • Logic: Needs to be declared at the top (before HTML) of all scripts that will need session to be functional, to allow shared access to certain variables in multiple scripts. PHP Function: session_start().
  • Logic: Update session variables which have been set. PHP Function: $_SESSION[].
  • Logic: Destroy/Unset Sessions. PHP Function: session_destroy() or unset().

5. What is the working logic & PHP function for Delete (CRUD)?

  • Logic: Update session variables which have been set. PHP Function: $_SESSION[].
  • Logic: Destroy/Unset Sessions. PHP Function: session_destroy() or unset().
  • Logic: Enable session support for a script. Set session variables. PHP Function: $_SESSION[].
  • Logic: Read session variables which have been set. PHP Function: $_SESSION[].

Comments

No comments have yet been made

Similar Computing resources:

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