Multiple choice technology enterprise content management

var expires = new Date(); expires.setTime(expires.getTime() + (1000 * 3600 * 24 * 30)); setCookie("myCookie", expires.toString(), expires.toUTCString()); Which statements are valid for the above code: Choose all that are applicable.

  1. A cookie by Name cookie-myCookie is created.

  2. The cookie will expire exactly 15 days from the time it is created.

  3. The cookie will expire exactly 30 days from the time it is created.

  4. A cookie by Name myCookie is created.

  5. Since the setTime function will fail, the cookie will never expire.

Reveal answer Fill a bubble to check yourself
C,D Correct answer
Explanation

The code calculates milliseconds for 30 days (1000 * 3600 * 24 * 30) and adds it to the current time, setting the cookie to expire in 30 days. The setCookie call creates a cookie named "myCookie".