两个单点登陆的项目在同一台服务器上运行,缓存设置用的是ehcache。
在同一浏览器上对这两个项目进行访问,两个项目相互干扰,访问后台接口时跳转单点登陆页面
<?xml version="1.0" encoding="UTF-8"?>
<ehcache name="shirocache">
<!-- 磁盘缓存位置 -->
<diskStore path="java.io.tmpdir"/>
<!-- 默认配置 -->
<defaultCache
eternal="false"
maxElementsInMemory="10000"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false"
memoryStoreEvictionPolicy="LFU"/>
<!-- 系统会话缓存 -->
<cache name="shiro-activeSessionCache"
eternal="false"
maxElementsInMemory="10000"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="true"
diskPersistent="true"
diskExpiryThreadIntervalSeconds="6000"/>
</ehcache>
在两个服务器上分别运行两个项目的话,则用浏览器访问这两个项目不会相互干扰。
这个两个项目中ehcache-shiro.xml 的配置信息一样,内容是代码片中的内容
希望路过的大神可以帮帮忙