Ask Question
17 December, 09:13

Var cookie = "username=mike2009";

cookie + = "; max-age=" + 365 * 24 * 60 * 60;

cookie + = "; path=/";

document. cookie = cookie;

(Refer to code example 15-1.) This code

creates a cookie that's removed when the user closes the browser

creates a cookie that's stored for 1 year

creates a cookie that's stored for 365 minutes

does not create a cookie

+4
Answers (1)
  1. 17 December, 09:32
    0
    creates a cookie that stored for 1 year.

    Explanation:

    The code snippet creates a cookie with name mike2009. max-age is used to delete the cookie max-age takes the time in seconds so 365*24*60*60 is equal to 1 year. max-age attribute will delete the cookie after 1 year. In this code max-age is used but expires is used most often because it is supported by all of the browsers max-age is not supported by internet explorer,
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Var cookie = "username=mike2009"; cookie + = "; max-age=" + 365 * 24 * 60 * 60; cookie + = "; path=/"; document. cookie = cookie; (Refer to ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers