Flush cache when logging out