public void onPageEvent ( long officialTime ) { //cleanup expired sessions ArrayList garbage = new ArrayList ( sessionsMirror . size ( ) ) ; Iterator i ; StandardSession session ; synchronized ( sessionsMirror ) { i = sessionsMirror . values ( ) . iterator ( ) ; while ( i . hasNext ( ) ) { session = ( StandardSession ) i . next ( ) ; if ( session . isExpired ( ) ) { garbage . add ( session ) ; } } } i = garbage . iterator ( ) ; while ( i . hasNext ( ) ) { session = ( StandardSession ) i . next ( ) ; System . out . println ( new LogEntry ( "session " + session . getToken ( ) + " expired..." ) ) ; this . destroySessionByToken ( session . getToken ( ) ) ; } }
Cleans up expired sessions .