How cookies and sessions work

Overview

Now that I've learned about cookies and sessions, I'll output them as my own notes.

Introduction

You can log in ** without entering your login information on the shopping site, or ** (unless you delete it) the items in your cart will remain in your cart for a while **. This is possible because of the ** session ** and ** cookie ** mechanisms.

Session

--Mechanism that temporarily retains information in Web services --A series of communications from the start to the end of access --In Rails, it is stored in an object called session in the form of a hash.

This article was easy to imagine and helpful!

Cookie

-** Area that the browser has ** data can be saved --Where to save session information (ID) --There is an expiration date

This article was easy to imagine and helpful!

CookieStore

-The default save destination when using a session with ** Rails ** --Session information is encrypted and stored in the browser cookie --Save session in hash format

Summary

--A session is a series of communications from the beginning to the end of access. --What is a cookie? A browser area that stores user data (ID) such as sessions. --Session is an object when using a session in Rails --What is CookieStore? The default save destination when using a session with Rails

References

--Rails Security Guide -"Cookie" course that even beginners can understand Dangers and setting methods on smartphones are explained in detail -IT Glossary (cookies) that makes you feel "understood" even if you "understand" and "do not understand" -IT Glossary (Session) that makes you feel like you understand even if you don't understand it. -[Introduction to PHP] Cookies and Sessions -Understanding cookies and sessions -Difference between session and cookie

Recommended Posts

How cookies and sessions work
Easily organize cookies, sessions and caches
Differences between browser sessions and cookies and Rails session and cookies methods
Ruby: How to use cookies
How to use StringBurrer and Arrays.toString.
How to use EventBus3 and ThreadMode
How to call classes and methods
How to use equality and equality (how to use equals)
How to connect Heroku and Sequel
How to convert LocalDate and Timestamp
How arrays work in Java (illustration)