public boolean refreshSession ( String sessionKey , int expireDays ) throws PersistenceException { Calendar cal = Calendar . getInstance ( ) ; cal . add ( Calendar . DATE , expireDays ) ; Date expires = new Date ( cal . getTime ( ) . getTime ( ) ) ; // attempt to update an existing session row, returning true if we found and updated it return ( update ( "update sessions set expires = '" + expires + "' " + "where authcode = " + JDBCUtil . escape ( sessionKey ) ) == 1 ) ; }
Validates that the supplied session key is still valid and if so refreshes it for the specified number of days .