How can you handle CORS to allow cookies to be included in requests?
- Access-Control-Allow-Origin: *
- Access-Control-Allow-Credentials: true
- Access-Control-Allow-Headers: *
- Access-Control-Allow-Methods: GET, POST
To allow cookies to be included in CORS requests, you should set the Access-Control-Allow-Credentials header to true. The other options are related to different aspects of CORS, but they don't specifically enable cookie handling.
Loading...
Related Quiz
- You are maintaining a server that has strict security requirements. You need to allow cross-origin requests but with stringent restrictions. How can you implement CORS to fulfill these requirements while maintaining security?
- ________ is a security practice that involves encoding information so that only authorized parties can access it.
- You are developing a media hosting platform where users can upload images and videos. How would you design the file storage and retrieval system to ensure high availability and low latency for users across the globe?
- How can you remove a listener from an event using the Events module in Node.js?
- How can you destructure nested properties in objects using JavaScript?