Handle sessions globally and update navigation.