Allow the cookie expiration length to be set from settings. Closes #208