The user's action is required. Of course.
If he goes to a page, what my code is suppose to do is, checking if he is still logged in. If he is not, he gets redirected to a new login screen.
I think if you wanted to log the user off without him doing anything, literally just sitting there, what you would need to do is implement a JavaScript (JS) counter that does some sort of thing (reroute, popup, ...) when he is logged out due to inactivity.
However, a JS solution depends extremely on the client. If JS is turned off, the users will get nothing.
I hope that helps!
_till