Cookies enable programs to save data in the browser of a user. Applications can use the session storage attribute to save data until the window is closed. The local storage attribute allows apps to keep data indefinitely.