Fixes the bug that the session would expire after a while, although the user is active. Also refactored the corresponding code into seperate component.