shiro RememberMe记住我功能(Shiro rememberme)

shiro记住我功能,实体类必须继承序列化对象Serializable,记住我功能和 cookie差不多。
关了浏览器不输入密码就能访问,但是换个浏览器就不行了,应为这是保存在浏览器上的。

所谓的Serializable,就是java提供的通用数据保存和读取的接口。至于从什么地方读出来和保存到哪里
去都被隐藏在函数参数的背后了。这样子,任何类型只要实现了Serializable接口,就可以被保存到文件中,或者作为数据流通过网络发送到别的地方。也可以用管道来传输到系统的其他程序中。这样子极大的简化了类的设计。只要设计一个保存一个读取功能就能解决上面说得所有问题。
java的”对象序列化”能让你将一个实现了Serializable接口的对象转换成一组byte,这样日后要用这个对象时候,你就能把这些byte数
据恢复出来,并据此重新构建那个对象了。

————————

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.