I am using the Tomcat 9 and JNDIRealm with Basic Auth to authenticate users. The problem is that once the user closes the Web Browser he is challenged again for username & password. This is also according to the documentation I could find for Tomcat:
Once a user has been authenticated, the user (and his or her associated roles) are cached within Tomcat for the duration of the user's login. (For FORM-based authentication, that means until the session times out or is invalidated; for BASIC authentication, that means until the user closes their browser)
This behaviour is pretty annoying as the users have to login every time after they closed the browser. My wish would be that a user login is cached for 1 week. Only then a challenge for the credentials should happen. Is there any way to change this default behaviour?