Do sessionDAO and cacheManager in shiro need to be set up at the same time?

recently, we integrated shiro with springboot and used redis as the session cache container for shiro. Most netizens on Baidu shiro configured the same cacheManager and sessionDAO, in SecurityManager and checked the source code with questions. We found that the storage of shiro"s session only needs to inherit the AbstractSessionDAO implementation, the abstract method in which redis is used to save session, so it is doubtful why we still need to implement CacheManager interface, and then SecurityManager configure a cacheManager, which is not superfluous. It"s not useful at all. I don"t know if I understand it correctly. Please let me know clearly. Thank you here!

clipboard.png

Mar.06,2021

CacheManager is CacheManager
SessionDAO is SessionDAO
their responsibilities are different

SessionDAO can implement cached or non-cached

for your question
just want to save Session in Redis, to naturally implement the SessionDAO of Redis
and CacheManager is not only used for CachingSessionDAO, but also CachingRealm

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35e6b-2bfe4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35e6b-2bfe4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?