shiro RememberMe记住我功能(Shiro rememberme)

shiro记住我功能,实体类必须继承序列化对象Serializable,记住我功能和 cookie差不多。



Shiro remembers that entity classes must inherit serializable serialized objects. Remember that my functions are similar to cookies.
You can access it without entering a password after closing the browser, but you can’t change the browser. It should be saved on the browser.

The so-called serializable is the general data saving and reading interface provided by Java. As for where to read it and where to save it
It is hidden behind the function parameters. In this way, as long as any type implements the serializable interface, it can be saved to a file or sent to other places as a data stream over the network. It can also be piped to other programs in the system. This greatly simplifies the design of classes. As long as we design a save and read function, we can solve all the problems mentioned above.
Java’s “object serialization” allows you to convert an object that implements the serializable interface into a set of bytes, so that you can count these bytes when you want to use this object in the future
It was recovered and the object was rebuilt accordingly.