Added second cookie to check for expiration by age
Added isExpired function
Refactored