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