MCQ Hive stays free thanks to ads. Please disable your ad blocker for this site so content and features keep working.
Web Development
Server-Side & Architecture
Beginner
Q
Which statement about cookies and localStorage is correct?
ACookies are sent to the server with every matching HTTP request; localStorage stays in the browser and is never sent automatically
BlocalStorage is sent; cookies are not
CBoth are sent with every request
DNeither is ever accessible to JavaScript
Correct Answer:
A. Cookies are sent to the server with every matching HTTP request; localStorage stays in the browser and is never sent automatically
Explanation:
Large cookies add overhead to every request, which is why bulky data belongs in localStorage.
ALSO KNOW (related points):
• In MVC architecture, what does the Controller do? → It handles input, works with the Model, and selects the View to render
• What does a WebSocket provide? → A persistent, full-duplex connection between the browser and the server, for real-time data
• What two things does a Progressive Web App (PWA) need to be installable? → A web app manifest and a service worker, served over HTTPS