In standard Wordpress, your login will be saved for 48 hours, or 14 days if you click "remember me" on login. This configuration snippet allows you to extend that time to 30 days.
For this to work, your Wordpress has to live inside an Apache server, and the apache server has to have
mod_headers activated. Then, include the file
extend_wordpress_cookie_lifetime.conf
into the configuration of your Apache server using
the Include directive.
The snipped is configured to extend the valitiy to 30 days or 2592000 seconds. Feel free to change that value, but be aware of the year 2038 problem.
Longer cookie lifetime means your cookie is more valuable if it's stolen. Always use SSL, it's dead simple with Apache thanks to letsencrypt.
If a cookie gets stolen, you can logout yourself out of "other sessions" using a button in your Wordpress profile, here is an explanation. Programmatically, do it following this stackexchange answer.
The snippet currently does not strip the "old" Max-Age value from the cookie, though it could easily extended to do so. So the cookie might end up with two Max-Age settings. It depends on the browser how two conflicting Max-Age values are handled.