1、session 不同步问题
index.jsp
session的内容:<%=session。getId()%>
2、用redis共享session
将如下几个jar拷贝到${TOMCAT_HOME}/lib下
tomcat-redis-session-manager-VERSION.jar
jedis-2.5.2.jar
commons-pool2-2.2.jar
配置tomcat
编辑${TOMCAT_HOME}/conf/context.xml,在context中加入
port=”6379”
database=”0”
maxInactiveInterval=”60” />
其中host和port为redis的ip和端口
至此配置完成,tomcat会使用redis来托管session。
