Chapter 7. Cookies

JavaScript is a purely client-side technology. Admittedly, it is possible to use JavaScript on the server, but this has nothing to do with JavaScript running in the browser; it is a similar syntax in a completely different context.

Usually, JavaScript is completely restricted to the current page and does not have access to something from the server. There are very few exceptions to this rule. One exception can be found in Chapter 11, “AJAX (and Related Topics),” and another one is covered in this chapter.

Cookies are not a specific browser technology, but a mechanism in the client/server model to overcome one major shortcoming in the HTTP protocol. HTTP is stateless, which means that the protocol does not have a memory. A client ...

Get JavaScript™ Phrasebook: Essential Code and Commands now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.