That is a very common simple scenario, yet an involved topic based on what you are trying to avoid or accomplish, and there are two aspects to consider.
Usually with well developed web applications, session and cache are well managed by the application. The first thing testers will do when expecting an odd situation example after I log out I can continue with the session, is to run the Chrome browser in "Incognito" mode or the Edge browser in "InPrivate" mode. This can also be accomplished by running the browser with a command line option.
Launch Browser in Incognito/Private Mode | SmartBear Community
Sometimes a reboot solves the issue and that is due to a browser bad state process. When you close the browser all instances of the process would close and sometimes they stay behind and starting browser revert back to the same state. You will need to check and terminate processes. Edge by design does not close the processes.
https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/window-and-process/terminate-method-process-object.html