This is because of the way browsers operate. The session is preserved so that accidentally closing a window would not require you to log back in for example. If you want to ensure that the session will be terminated you can log out, or use an incognito session for logging in.
The support team of the browser you are using could also help you set up the browser to terminate these sessions immediately if possible. For instance, there's an option "Clear cookies and site data when you quit Chrome" in Google Chrome.
If you close your browser without logging out and then open again 3 hours later to access it, you will have to log in again. This is because the session is terminated, and you will need to be authenticated in order to log in again.