Storage and browser security

Private browsing storage

Understand that private sessions isolate and discard local browsing data without making network activity anonymous.

8 minute lesson

~~~

A private window normally uses a storage context separated from the regular browser profile. Cookies and other local site data created there are temporary and are discarded when the browser’s private session ends.

Exact lifetime and isolation details vary by browser. Several private windows may share one private session until all of them close, so closing a single window is not always the cleanup boundary.

Private browsing protects mainly against leaving local history and site data in the regular profile. It does not make a visitor anonymous:

  • the site still receives the connection and request data
  • a network administrator or internet provider can still observe traffic metadata
  • downloads and bookmarks may remain on the device
  • signing in still identifies the account

Test the boundary yourself. In a regular window, set a distinctive localStorage value. Open the same origin in a private window and check whether it exists. Set another value privately, close every private window, reopen one, and inspect again.

Application code must handle unavailable or short-lived storage gracefully. Do not use private-mode detection as an authentication or security feature, and do not promise users anonymity the browser cannot provide.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →