Which of the following statements are trueI cookie.setMaxAge(0) – delete the cookieII cookie.setMaxAge(1) –the cookie will live before it expiresIII cookie.setMaxAge(-1) – the cookie will not be stored beyond this session.

Skill/Topic: JSP Life Cycle
A) I only
B) II, III only
C) I, II only
D) I, II, III

Showing Answers 1 - 3 of 3 Answers

akantilal

  • Jun 13th, 2007
 

cookie.setMaxAge(0) is used to delete a cookie. So first one is true.

cookie.setMaxAge(1) sets the cookie age to 1 second. Your statement "the cookie will live before it expires" is bit confusing and it is difficult to say whether it is true or not. But looks like it is true.

cookie.setMaxAge(-1) indicates that the cookie will expire once the browser is closed. Closing the session need not be the same as closing the browser. So third one is false.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions