only if you controlled what happens when someone clicks in the first place.
so what you need to establish is a dynamic control element that generally determines what will happen as soon as the click (or other interaction) has occurred.
This is not so easy since you dont want that to happen after the request to the server has been sent but before - after all you want to control navigation after the server has determined that the session has expired but before the user has set activity, at least I understood it that way.
So I see 3 "established" possibities, unless you accept that you have to wait for the clients next request to block him. (So he get logged after 30 mins inactivity but gets that information only when he tries to continue the session)
1) navigation = java applet
with an applet you can establish a persistent connection and have the possibility to "push" the information to the client
2) naviagtion = flash
same thing - persistent connection possible, therefor "push" possible
3) active control via clientsided scripts (dynamic link generation for example) including the aforementioned reload thingy
mind that 3) is propably easiest (IMHO) to do but you will want to consider some security issues when going this way.
I would not claim that these are all or even the best ways...
Just the things that I'm thinking of atm.
jakob
[EDIT]
hrmpf. high time to leave office
yes it is.
if($answer_from_db == true && $color_of_sky == 'shiny'){
//put out requested content
}elseif($answer_from_db == true && $color_of_sky == 'not shiny'){
// put out other content
}else{
// and now something completely different
}
hope this is a better answer to your question
[/EDIT]