The browser still sends the cookie with requests, but document.cookie cannot read it, so an XSS bug cannot simply steal a session cookie.