HTTPS & cookies
CORS (Cross-Origin Resource Sharing) headers decide which other websites' JavaScript may read responses from your server.
Not sure whether your site has this problem? Check it in seconds.
A public API that returns the same data to everyone is normally fine with Access-Control-Allow-Origin: *. It becomes a risk when responses depend on the logged-in user and the server allows arbitrary origins together with credentials, or blindly reflects whatever Origin it receives.
Send a request with an Origin header from a site you don't own and look at the Access-Control-Allow-Origin and Access-Control-Allow-Credentials response headers. Our CORS checker does this safely.
Allowlist (Express)
const allowed = new Set(['https://app.example.com', 'https://www.example.com']);
app.use((req, res, next) => {
const origin = req.headers.origin;
if (origin && allowed.has(origin)) {
res.setHeader('Access-Control-Allow-Origin', origin);
res.setHeader('Vary', 'Origin');
}
next();
});No. Browsers reject a wildcard origin when credentials are included.
Guidance is general. Test header and DNS changes on a staging copy first, and check your hosting provider's documentation for platform-specific steps.