Question Bank
1899 approved questions from the community
Which superglobal variable is used to store and retrieve session data in PHP?
What function must be called at the beginning of a PHP script to initialize a session?
Cookies are stored on the server side.
PHP constants can only store string values.
What is the purpose of the `req.originalUrl` property?
The `res.location()` method sets the Location header but does not send a response.
The `req.secure` property indicates whether the request was made over HTTPS.
How do you set custom HTTP response headers in Express.js?
What is the purpose of the `req.baseUrl` property?
The `res.attachment()` method sets the Content-Disposition header to trigger file downloads.
What does the morgan middleware do in Express.js?
What is the purpose of the express-validator package?
Express.js applications should always use HTTPS in production environments.
The order of middleware registration matters in Express.js.
Express.js automatically parses all types of request bodies without any middleware.
What is the purpose of the helmet middleware in Express.js?
Express.js applications should use environment variables for configuration in production.
The `app.set()` method in Express.js is used to assign application settings.
What is the purpose of the `app.route()` method in Express.js?
How do you set response headers in Express.js?