public boolean hasExpired ( ) { if ( maxAge == 0 ) return true ; // if not specify max-age, this cookie should be // discarded when user agent is to be closed, but // it is not expired. if ( maxAge == MAX_AGE_UNSPECIFIED ) return false ; long deltaSecond = ( System . currentTimeMillis ( ) - whenCreated ) / 1000 ; if ( deltaSecond > maxAge ) return true ; else return false ; }
Reports whether this http cookie has expired or not .