© Stefan Wintermeyer 2018
Stefan WintermeyerLearn Rails 5.2https://doi.org/10.1007/978-1-4842-3489-1_8

8. Cookies and Sessions

Stefan Wintermeyer1 
(1)
Bochum, Germany
 

In this chapter, I’ll talk about cookies and sessions.

Cookies

With a cookie, you can store information on the web browser’s system in the form of strings as key-value pairs that the web server has previously sent to this browser. The information is later sent from the browser to the server in the HTTP header. A cookie (if configured accordingly) is not deleted from the browser system by restarting the browser or by restarting the system. Of course, the browser’s human user can manually delete the cookie.

 A browser does not have to accept cookies, and it does not have to save them either. ...

Get Learn Rails 5.2: Accelerated Web Development with Ruby on Rails now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.