How to make resuming login optional?

I’d like to make it optional for users to be logged in automatically across sessions. You know, the usual thing with a checkbox on the login form saying something like “Remember me”.

There doesn’t seem to be any standard way of doing it, though – or am I missing something obvious?

So I am not sure how you would implement this using the build in accounts package, mainly because Meteor uses local storage with tokens not session cookies to authenticate, and while you can set the expiration date of a token, you can’t set it to expire when the window is closed, because local storage persists between sessions.

Meteor has a minimum session length of 1 hour and check if the token has expired every 10 minutes. The default token expiration is 90 days however you can configure this in the Account config, see here for info about config.