[Java] Easily combine cookies, sessions and caches

less than 1 minute read

・Obtains and saves “Who?” information.

  • Because of the password and user_id, it is dangerous for security. Therefore, the information is held safely by the session.

  • The storage location is your PC (mainly the browser)

・Cookies can be disabled.

Session

・I have acquired and saved the information “What did you do?”

  • In many cases, it is generated in conjunction with cookies.

  • The information can be tracked not only in the browser but also in the server.

  • The session cannot be invalidated.

cache

  • A mechanism to temporarily store frequently used data in a faster storage device to speed up access.

・The information for speeding up is saved.

Three differences

The main difference between cache and cookies and sessions is Whereas the cache stores information for faster display, Cookies and sessions store user information.