Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

Tomcat7 SESSIONID keep changing after applied redis RedisSessionManager applies

$
0
0

I'm using tomcat7 with oracle-java8 in Ubuntu16.04.

And I start 2 different tomcat instances for load balancing, but the default behavior is that the session cannot share between them.

So I turned to the solution using RedisSessionManager in it.

After I add the below lines in the tomcat conf/context.xml file (of course I did added the dependency jars in the lib directory):

<Valve className="com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve" /><Manager className="com.orangefunction.tomcat.redissessions.RedisSessionManager"             host="127.0.0.1"             port="6379"             database="0"             password="defuRedis2017"             maxInactiveInterval="60" />

Then start a single tomcat instance.

But after that, the server seemed cannot save session any more, and returned a different Set-Cookie header in each request, so the login cannot work any more even with a single tomcat instance.

If I comment out the above lines (in the context.xml file), the session works as expected.

So what makes it wrong to working with the RedisSesssionManager?


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>