The maximum age of the cookie in JSP can be set by
cookie.setMaxAge(int seconds)
cookie.setMaxAge(float seconds)
cookie.setAgeMax (float seconds)
cookie.setAgeMax (int seconds)