Change session time out for link share files

Is it possible to shorten the session time after a password is entered to access a link shared file.

The scenario is:

I share a link to a file and password protect it.
My friend enters the password to access the file.
My friend closes the tab where she accessed the file.
She then enters the URL to that link shared file and isn’t prompted for the password.

How can I shorten the length of time that a password is required again?

By default once you share sth, cookie should be created and first time user opens link to shared file, that cookie should be stored on their computer. Thats most common approach to this. It should be implemented long ago.