Vidyalelo
JavaScript · Q134

Document Object Model And Event Handling

Programming · JavaScript · question 134

Q134

Which attribute is used to extend the lifetime of a cookie?

A.
higher-age
B.
increase-age
C.
max-age
Answer
D.
lifetime

Answer: Option C

Solution

Answer: Option C
Solution:
If you want a cookie to last beyond a single browsing session, you must tell the browser how long (in seconds) you would like it to retain the cookie by specifying a max-age attribute. If you specify a lifetime, the browser will store cookies in a file and delete them only once they expire.