magro / memcached-session-manager

A tomcat session manager that backups sessions in memcached and pulls them from there if asked for unknown sessions
Apache License 2.0
758 stars 348 forks source link

ctrl+F5 refresh the page,session invalidation #373

Open zq19880902 opened 6 years ago

zq19880902 commented 6 years ago

environment: jdk8,tomcat7,memcached-session-manager-2.1.1,memcached-session-manager-tc7-2.1.1,msm-kryo-serializer-2.1.1

tomcat context.xml is<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" memcachedNodes="n1:192.168.211.213:11211,n2:192.168.211.214:11211" sticky="false" sessionBackupTimeout="100" sessionBackupAsync="false" lockingMode="auto" requestUriIgnorePattern=".*\.(ico|png|gif|jpg|jpeg|bmp|css|js|html|htm)$" transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory" />

Question discrible: when I start my web application and login from login page,the session is image searched n1 memcached with E3E056B459B22FB18270BCC2E029F950-n1,the result is: image searched n2 memcached with E3E056B459B22FB18270BCC2E029F950-n1,the result is: image when I used F5 to refresh the page,session was ok,but when I used Ctrl+F5 to refresh the page twice,the session was became invalid,and the page redirected the login page image

but the session was still in n1 memcached and n2 memcached

magro commented 6 years ago

Sorry for the late response.

One question is how/when/why the session was stored in n2. For this a fresh conversation would have to be tested while analyzing logs to see when this happens.