public Boolean persist ( final String id , final Map < String , Object > snapshot , final int maxInactiveInterval ) { final String sid = sessionPrefix + ":" + id ; try { this . executor . execute ( new RedisCallback < Void > ( ) { public Void execute ( Jedis jedis ) { if ( snapshot . isEmpty ( ) ) { // delete session jedis . del ( sid ) ; } else { // set session jedis . setex ( sid , maxInactiveInterval , serializer . serialize ( snapshot ) ) ; } return null ; } } ) ; return Boolean . TRUE ; } catch ( Exception e ) { log . error ( "failed to persist session(id={}, snapshot={}), cause:{}" , sid , snapshot , Throwables . getStackTraceAsString ( e ) ) ; return Boolean . FALSE ; } }
persist session to session store