You need to use JSF 2 Exception Handling feature at server side
and onError handler on client side.
thanks for the hint
I found a quick win solution but your suggestion is better since I may notify the user (popup) what has happened (session timeout) before redirecting to login page
I'm going to publish it later on