-
What is the purpose of the CodeIgniter Session library?
- A) To handle database interactions
- B) To manage user authentication
- C) To store user-specific data across multiple requests
- D) To generate HTML forms
Answer: C) To store user-specific data across multiple requests
-
How do you load the CodeIgniter Session library in a controller?
- A)
$this->load->library('session')
- B)
$this->session->load()
- C)
$this->session->library('session')
- D)
$this->library('session')
Answer: A)
$this->load->library('session')
- A)
-
Which CodeIgniter function is used to set session data?
- A)
set_session_data()
- B)
add_session_data()
- C)
store_session_data()
- D)
set_userdata()
Answer: D)
set_userdata()
- A)
-
How do you retrieve session data in a CodeIgniter controller?
- A)
$this->session->get()
- B)
$this->session->retrieve()
- C)
$this->session->userdata()
- D)
$this->session->fetch()
Answer: C)
$this->session->userdata()
- A)
-
Which of the following is NOT a valid session driver in CodeIgniter?
- A) File
- B) Database
- C) Memory
- D) Redis
Answer: C) Memory
-
What is the purpose of the CodeIgniter Encryption library?
- A) To encrypt and decrypt sensitive data
- B) To compress data before storing it
- C) To hash passwords for user authentication
- D) To encode data for secure transmission over the network
Answer: A) To encrypt and decrypt sensitive data
-
How do you load the CodeIgniter Encryption library in a controller?
- A)
$this->load->library('encryption')
- B)
$this->encryption->load()
- C)
$this->encryption->library('encryption')
- D)
$this->library('encryption')
Answer: A)
$this->load->library('encryption')
- A)
-
Which method is used to encrypt data using the CodeIgniter Encryption library?
- A)
encrypt()
- B)
encode()
- C)
encrypt_data()
- D)
encode_data()
Answer: A)
encrypt()
- A)
-
How do you decrypt data using the CodeIgniter Encryption library?
- A)
decrypt()
- B)
decode()
- C)
decrypt_data()
- D)
decode_data()
Answer: A)
decrypt()
- A)
-
Which CodeIgniter feature is used to execute custom code before and after a controller method is called?
- A) Filters
- B) Middleware
- C) Hooks
- D) Interceptors
Answer: C) Hooks
Comments