WordPress session times out – but doesn’t log out?

It could be a number of things. Do you check if the user is logged in on the relevant pages? For example:

is_user_logged_in() ||  auth_redirect();

error code: 523