Why we are used setMaxAge() and getMaxAge() in Cookies | Eklavya Online

Why we are used setMaxAge() and getMaxAge() in Cookies

Gets/sets how much time (in seconds) should elapse before the cookie expires. If you don’t set this, the cookie will last only for the current session (i.e. until the user quits the browser), and will not be stored on disk.