CS FundamentalsHardGATE CS · Product company CS fundamentals
Which cookie attribute stops JavaScript running in the page from reading the cookie through document.cookie?
- A. HttpOnly
- B. Secure
- C. SameSite=Strict
- D. Path=/
Correct answer: A. HttpOnly
HttpOnly hides the cookie from scripts, limiting session theft by XSS. Secure sends it only over HTTPS, SameSite restricts cross-site sending (CSRF defence), and Path limits which URLs receive it.
More Computer Networks questions
- A page at https://app.example.com uses fetch() to send a PUT request with a JSON body to https://api.example.com. What happens first?
- How does a WebSocket connection start?
- A REST API creates a resource in response to a POST. Which response is most appropriate?
- Which application protocols use UDP by default? SNMP, NTP, SSH, DHCP
- Uncompressed 1080p video (1920 × 1080 pixels, 24 bits per pixel, 30 frames/s) is sent over a network. What bit rate does it need?
- A 1 Gbps switch forwards a 1500-byte frame. A store-and-forward switch waits for the whole frame; a cut-through switch starts forwarding…