You would need to have a timer in the client that told the user that the session has timed out. There is nothing happening in the server that you can use to determine the session has expired.
This is flawed however since the user could have two windows open. One could happily be used whilst the other would be showing that the session was expired.
Suppose the session expiry is the default 120 minutes.
At each page load, start a javascript timer in the client. If 120 minutes passes, the session might have expired. Send a small ajax request to the server and if it replies with a session expired message, show a modal that advises the session has expired. Otherwise, wait a further 120 minutes and try again.
If you keep asking the server if the session is alive then it will always be alive.