Medium
Which option of the res.cookie method allows restricting access to the cookie so that it is not readable via client-side JavaScript?
res.cookie('session_id', 'xyz123', { ________: true });
Author: WeLoveDevsStatus: PublishedQuestion passed 2 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!
0
What is the fundamental difference between req.path and req.originalUrl in an application using sub-applications or mounted routers?0
Which architectural approach is most recommended for injecting business services into Express controllers to ensure testability and decoupling?0
What is the main function of the `req.fresh` property in an Express application?0
When is the callback defined by app.param('id', ...) executed in Express?0
When designing an Express API, why is it recommended to position logging middleware before request body parsing middleware?0
What critical vulnerability does this code present?
```
app.get('/download/:file', (req, res) => {
// Le nom du fichier est directement injecté depuis l'URL
const filePath = path.join(__dirname, 'uploads', req.params.file);
res.sendFile(filePath);
});
```0
What architectural strategy should be adopted to handle a CPU-intensive task without blocking the Express event loop?