Multiple choice

Which of the following methods in HttpCookie class returns the maximum age of the cookie in seconds?

  1. getMaxAgeInSeconds()

  2. getMaxAge()

  3. getMaximumAge()

  4. getMaximumAgeInSeconds()

  5. getAge()

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This is the correct choice. getMaxAge() method is present in the HttpCookie class. This method returns the maximum age of the cookie, specified in seconds.